mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-15 21:48:20 +02:00
Add isFirstSession property to context
This commit is contained in:
@@ -55,6 +55,7 @@ export function coreContext() {
|
||||
/* eslint-enable no-console */
|
||||
}
|
||||
};
|
||||
context.isFirstSession = !context.storage('sawSplash') && !context.storage('sawPrivacyVersion');
|
||||
|
||||
|
||||
/* User interface and keybinding */
|
||||
|
||||
@@ -14,12 +14,13 @@ export function uiSplash(context) {
|
||||
// If user has not seen this version of the privacy policy, show the splash again.
|
||||
let updateMessage = '';
|
||||
const sawPrivacyVersion = context.storage('sawPrivacyVersion');
|
||||
let showSplash = !context.storage('sawSplash');
|
||||
if (sawPrivacyVersion !== context.privacyVersion) {
|
||||
updateMessage = t('splash.privacy_update');
|
||||
context.storage('sawSplash', null);
|
||||
showSplash = true;
|
||||
}
|
||||
|
||||
if (context.storage('sawSplash')) return;
|
||||
if (!showSplash) return;
|
||||
|
||||
context.storage('sawSplash', true);
|
||||
context.storage('sawPrivacyVersion', context.privacyVersion);
|
||||
|
||||
@@ -15,8 +15,13 @@ export function uiVersion(context) {
|
||||
var matchedVersion = currVersion.match(/\d+\.\d+\.\d+.*/);
|
||||
|
||||
if (sawVersion === null && matchedVersion !== null) {
|
||||
isNewVersion = (context.storage('sawVersion') !== currVersion);
|
||||
isNewUser = !context.storage('sawSplash');
|
||||
if (context.storage('sawVersion')) {
|
||||
isNewUser = false;
|
||||
isNewVersion = context.storage('sawVersion') !== currVersion;
|
||||
} else {
|
||||
isNewUser = true;
|
||||
isNewVersion = true;
|
||||
}
|
||||
context.storage('sawVersion', currVersion);
|
||||
sawVersion = currVersion;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user