fix: Don't show the visual regression warning outside of CI

This commit is contained in:
Aria Minaei 2022-12-31 21:26:41 +01:00
parent 103c35737c
commit 4596c2233c

View file

@ -135,13 +135,15 @@ const GlobalToolbar: React.FC = () => {
const moreMenuTriggerRef = useRef<HTMLButtonElement>(null) const moreMenuTriggerRef = useRef<HTMLButtonElement>(null)
const showUpdatesBadge = useMemo(() => { const showUpdatesBadge = useMemo(() => {
if (hasUpdates || window.__IS_VISUAL_REGRESSION_TESTING) { if (window.__IS_VISUAL_REGRESSION_TESTING) {
if (!showedVisualTestingWarning) { if (!showedVisualTestingWarning) {
showedVisualTestingWarning = true showedVisualTestingWarning = true
console.warn( console.warn(
"Visual regression testing enabled, so we're showing the updates badge unconditionally", "Visual regression testing enabled, so we're showing the updates badge unconditionally",
) )
} }
}
if (hasUpdates || window.__IS_VISUAL_REGRESSION_TESTING) {
return true return true
} }