fix: show the beta warning on web
This commit is contained in:
@@ -63,8 +63,6 @@ const startApplication: StartApplication = async function startApplication(
|
|||||||
defaultSyncServerHost: string,
|
defaultSyncServerHost: string,
|
||||||
bridge: Bridge
|
bridge: Bridge
|
||||||
) {
|
) {
|
||||||
notifyBetaPeriodEnd();
|
|
||||||
|
|
||||||
SNLog.onLog = console.log;
|
SNLog.onLog = console.log;
|
||||||
startErrorReporting();
|
startErrorReporting();
|
||||||
|
|
||||||
@@ -150,19 +148,6 @@ const startApplication: StartApplication = async function startApplication(
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
function notifyBetaPeriodEnd() {
|
|
||||||
if (window.location.hostname === 'app-beta.standardnotes.org') {
|
|
||||||
alertDialog({
|
|
||||||
title: 'Beta period has ended',
|
|
||||||
text:
|
|
||||||
'Thank you for trying this beta version. Please sign out, then ' +
|
|
||||||
'sign in to <a href="https://app.standardnotes.org" target="_blank">' +
|
|
||||||
'app.standardnotes.org</a> ' +
|
|
||||||
'to continue using Standard Notes.',
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (__WEB__) {
|
if (__WEB__) {
|
||||||
startApplication((window as any)._default_sync_server, new BrowserBridge(__VERSION__));
|
startApplication((window as any)._default_sync_server, new BrowserBridge(__VERSION__));
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import {
|
|||||||
import { WebApplication } from '@/ui_models/application';
|
import { WebApplication } from '@/ui_models/application';
|
||||||
import { Editor } from '@/ui_models/editor';
|
import { Editor } from '@/ui_models/editor';
|
||||||
import { action, makeObservable, observable } from 'mobx';
|
import { action, makeObservable, observable } from 'mobx';
|
||||||
|
import { Bridge } from '@/services/bridge';
|
||||||
|
|
||||||
export enum AppStateEvent {
|
export enum AppStateEvent {
|
||||||
TagChanged = 1,
|
TagChanged = 1,
|
||||||
@@ -77,7 +78,8 @@ export class AppState {
|
|||||||
constructor(
|
constructor(
|
||||||
$rootScope: ng.IRootScopeService,
|
$rootScope: ng.IRootScopeService,
|
||||||
$timeout: ng.ITimeoutService,
|
$timeout: ng.ITimeoutService,
|
||||||
application: WebApplication
|
application: WebApplication,
|
||||||
|
private bridge: Bridge,
|
||||||
) {
|
) {
|
||||||
this.$timeout = $timeout;
|
this.$timeout = $timeout;
|
||||||
this.$rootScope = $rootScope;
|
this.$rootScope = $rootScope;
|
||||||
@@ -133,7 +135,7 @@ export class AppState {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private determineBetaWarningValue() {
|
private determineBetaWarningValue() {
|
||||||
if ((window as any).electronAppVersion?.includes('-beta')) {
|
if (this.bridge.appVersion.includes('-beta')) {
|
||||||
switch (localStorage.getItem(SHOW_BETA_WARNING_KEY)) {
|
switch (localStorage.getItem(SHOW_BETA_WARNING_KEY)) {
|
||||||
case 'true':
|
case 'true':
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -63,7 +63,8 @@ export class ApplicationGroup extends SNApplicationGroup {
|
|||||||
const appState = new AppState(
|
const appState = new AppState(
|
||||||
this.$rootScope,
|
this.$rootScope,
|
||||||
this.$timeout,
|
this.$timeout,
|
||||||
application
|
application,
|
||||||
|
this.bridge,
|
||||||
);
|
);
|
||||||
const archiveService = new ArchiveManager(
|
const archiveService = new ArchiveManager(
|
||||||
application
|
application
|
||||||
|
|||||||
@@ -573,7 +573,7 @@ class FooterViewCtrl extends PureViewCtrl<{}, {
|
|||||||
title: 'You are using a beta version of the app',
|
title: 'You are using a beta version of the app',
|
||||||
text:
|
text:
|
||||||
'If you wish to go back to a stable version, make sure to sign out ' +
|
'If you wish to go back to a stable version, make sure to sign out ' +
|
||||||
'before installing it.<br>You can silence this warning in the ' +
|
'of this beta app first.<br>You can silence this warning from the ' +
|
||||||
'<em>Account</em> menu.'
|
'<em>Account</em> menu.'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user