-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(Desktop): Make first launch experience work across platforms
- Loading branch information
1 parent
1504b37
commit af5cca8
Showing
4 changed files
with
41 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { app } from 'electron' | ||
import path from 'path' | ||
import { | ||
getAppConfig, | ||
setAppConfig, | ||
UnprotectedStoreKeys | ||
} from '../store/handlers' | ||
|
||
const storeName = 'unprotected.json' | ||
const userDataPath = app.getPath('userData') | ||
export const unprotectedStorePath = path.join(userDataPath, storeName) | ||
|
||
/** | ||
* Checks whether the app is being launched for the first time | ||
*/ | ||
export const isFirstLaunch = (): boolean => { | ||
const config = getAppConfig(UnprotectedStoreKeys.FIRST_LAUNCH) | ||
return typeof config === 'boolean' ? config : true | ||
} | ||
|
||
export const setFirstLaunchState = (value: boolean) => { | ||
setAppConfig(UnprotectedStoreKeys.FIRST_LAUNCH)(value) | ||
} |