fix: show the beta warning on web

This commit is contained in:
Baptiste Grob 2020-11-20 12:14:39 +01:00
parent 93876a11eb
commit b0ccecbd96
No known key found for this signature in database
GPG key ID: 4CC6BD922C8AF137
4 changed files with 7 additions and 19 deletions

View file

@ -63,8 +63,6 @@ const startApplication: StartApplication = async function startApplication(
defaultSyncServerHost: string,
bridge: Bridge
) {
notifyBetaPeriodEnd();
SNLog.onLog = console.log;
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__) {
startApplication((window as any)._default_sync_server, new BrowserBridge(__VERSION__));
} else {

View file

@ -15,6 +15,7 @@ import {
import { WebApplication } from '@/ui_models/application';
import { Editor } from '@/ui_models/editor';
import { action, makeObservable, observable } from 'mobx';
import { Bridge } from '@/services/bridge';
export enum AppStateEvent {
TagChanged = 1,
@ -77,7 +78,8 @@ export class AppState {
constructor(
$rootScope: ng.IRootScopeService,
$timeout: ng.ITimeoutService,
application: WebApplication
application: WebApplication,
private bridge: Bridge,
) {
this.$timeout = $timeout;
this.$rootScope = $rootScope;
@ -133,7 +135,7 @@ export class AppState {
}
private determineBetaWarningValue() {
if ((window as any).electronAppVersion?.includes('-beta')) {
if (this.bridge.appVersion.includes('-beta')) {
switch (localStorage.getItem(SHOW_BETA_WARNING_KEY)) {
case 'true':
default:

View file

@ -63,7 +63,8 @@ export class ApplicationGroup extends SNApplicationGroup {
const appState = new AppState(
this.$rootScope,
this.$timeout,
application
application,
this.bridge,
);
const archiveService = new ArchiveManager(
application

View file

@ -573,7 +573,7 @@ class FooterViewCtrl extends PureViewCtrl<{}, {
title: 'You are using a beta version of the app',
text:
'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.'
});
}