feat: improve bridge and exported types
This commit is contained in:
@@ -53,17 +53,16 @@ import {
|
||||
|
||||
import { trusted } from './filters';
|
||||
import { isDev } from './utils';
|
||||
import { Bridge, BrowserBridge } from './services/bridge';
|
||||
import { BrowserBridge } from './services/browserBridge';
|
||||
import { startErrorReporting } from './services/errorReporting';
|
||||
import { alertDialog } from './services/alertService';
|
||||
import { StartApplication } from './startApplication';
|
||||
import { Bridge } from './services/bridge';
|
||||
|
||||
if (__WEB__) {
|
||||
startApplication((window as any)._default_sync_server, new BrowserBridge());
|
||||
} else {
|
||||
(window as any).startApplication = startApplication;
|
||||
}
|
||||
|
||||
async function startApplication(defaultSyncServerHost: string, bridge: Bridge) {
|
||||
const startApplication: StartApplication = async function startApplication(
|
||||
defaultSyncServerHost: string,
|
||||
bridge: Bridge
|
||||
) {
|
||||
notifyBetaPeriodEnd();
|
||||
|
||||
SNLog.onLog = console.log;
|
||||
@@ -77,7 +76,7 @@ async function startApplication(defaultSyncServerHost: string, bridge: Bridge) {
|
||||
.config(configRoutes)
|
||||
.constant('bridge', bridge)
|
||||
.constant('defaultSyncServerHost', defaultSyncServerHost)
|
||||
.constant('appVersion', __VERSION__);
|
||||
.constant('appVersion', bridge.appVersion);
|
||||
|
||||
// Controllers
|
||||
angular
|
||||
@@ -149,7 +148,7 @@ async function startApplication(defaultSyncServerHost: string, bridge: Bridge) {
|
||||
angular.element(document).ready(() => {
|
||||
angular.bootstrap(document, ['app']);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
function notifyBetaPeriodEnd() {
|
||||
if (window.location.hostname === 'app-beta.standardnotes.org') {
|
||||
@@ -163,3 +162,9 @@ function notifyBetaPeriodEnd() {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (__WEB__) {
|
||||
startApplication((window as any)._default_sync_server, new BrowserBridge(__VERSION__));
|
||||
} else {
|
||||
(window as any).startApplication = startApplication;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user