Skip to content

Commit

Permalink
fix wizard opening every time on start even when completed
Browse files Browse the repository at this point in the history
Summary:
1. When setup wizard was first launched some people may have manually added aother values in local storage that are not literal string "true". This may cause setup wizard to still open when flipper is relaunched. Now we check for any value. If the key is not set in localStorage. it will return `null`.
2. Actually only open setup wizard when it has **NOT** been completed 🤦

Reviewed By: mweststrate

Differential Revision: D52456307

fbshipit-source-id: 4fc070af27645661e43dbf664d7474c85d32a1e5
  • Loading branch information
antonk52 authored and facebook-github-bot committed Dec 29, 2023
1 parent 85ed1ab commit def32e9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion desktop/flipper-ui/src/chrome/FlipperSetupWizard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,6 @@ export function hasSetupWizardCompleted(
): boolean {
return (
!localStorage ||
localStorage.getItem(SETUP_WIZARD_FINISHED_LOCAL_STORAGE_KEY) !== 'true'
localStorage.getItem(SETUP_WIZARD_FINISHED_LOCAL_STORAGE_KEY) != null
);
}
2 changes: 1 addition & 1 deletion desktop/flipper-ui/src/sandy-chrome/SandyApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export function SandyApp() {

uiPerfTracker.track('ui-perf-sandy-container-rendered');

if (hasSetupWizardCompleted(window.localStorage)) {
if (!hasSetupWizardCompleted(window.localStorage)) {
Dialog.showModal((onHide) => (
<FlipperSetupWizard onHide={onHide} closable={false} />
));
Expand Down

0 comments on commit def32e9

Please sign in to comment.