feat: pass web app version to snjs application (#623)

* feat: store web version in local storage

* feat: pass web app version to snjs application when creating WebApplication

* refactor: pass version in application constructor, remove unnecessary method

* refactor: move global variables declarations to separate files to avoid declaring them in all places where they are used

* refactor: better way to use global variables

* chore: add comment

* chore: make global constants pascal case

* chore: version bump for snjs

* chore: yarn.lock with correct snjs version

* chore: bump snjs version
This commit is contained in:
Vardan Hakobyan
2021-09-06 10:36:57 +04:00
committed by GitHub
parent b7d10810a5
commit 041d437bd4
7 changed files with 30 additions and 25 deletions

View File

@@ -1,4 +1,5 @@
import { Platform, platformFromString } from '@standardnotes/snjs';
import { IsDesktopPlatform, IsWebPlatform } from '@/version';
declare const process: {
env: {
@@ -160,16 +161,12 @@ export async function preventRefreshing(
}
}
/** Platform-detection functions */
declare const __WEB__: boolean;
declare const __DESKTOP__: boolean;
if (!__WEB__ && !__DESKTOP__) {
if (!IsWebPlatform && !IsDesktopPlatform) {
throw Error(
'Neither __WEB__ nor __DESKTOP__ is true. Check your configuration files.'
);
}
export function isDesktopApplication() {
return __DESKTOP__;
return IsDesktopPlatform;
}