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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user