Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

Svelte: fix welcome banner flashing on reload#64251

Merged
camdencheek merged 1 commit intomainfrom
cc/fix-welcome-flash
Aug 2, 2024
Merged

Svelte: fix welcome banner flashing on reload#64251
camdencheek merged 1 commit intomainfrom
cc/fix-welcome-flash

Conversation

@camdencheek
Copy link
Member

@camdencheek camdencheek commented Aug 2, 2024

Fixes SRCH-831

Test plan

Local test that the banner no longer flashes on refresh.

@cla-bot cla-bot bot added the cla-signed label Aug 2, 2024

$: welcomeOverlayDismissed = $temporarySettingsStorage.get('webNext.welcomeOverlay.dismissed', false)
$: showWelcomeOverlay = !$welcomeOverlayDismissed ?? false
$: showWelcomeOverlay = !($welcomeOverlayDismissed ?? true)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we have not yet loaded temporary settings, $welcomeOverlayDismissed will be undefined, which is falsy, which would cause us to show the welcome overlay. Instead, until we've loaded temporary settings, we prefer to not show the welcome overlay.

This means the overlay might pop up slightly after the page is loaded, but that's a reasonable price to pay for something that should happen ~once and keeps us from flashing the overlay every time.

@camdencheek camdencheek requested a review from a team August 2, 2024 17:09
@camdencheek camdencheek enabled auto-merge (squash) August 2, 2024 17:12
@camdencheek camdencheek merged commit b4566aa into main Aug 2, 2024
@camdencheek camdencheek deleted the cc/fix-welcome-flash branch August 2, 2024 17:16
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants