internal: move home server into internal flag
This commit is contained in:
@@ -4,7 +4,7 @@ import {
|
||||
HomeServerManagerInterface,
|
||||
HomeServerEnvironmentConfiguration,
|
||||
} from '@web/Application/Device/DesktopSnjsExports'
|
||||
import { HomeServer, HomeServerInterface } from '@standardnotes/home-server'
|
||||
import { HomeServerInterface } from '@standardnotes/home-server'
|
||||
|
||||
import { WebContents } from 'electron'
|
||||
import { MessageToWebApp } from '../../Shared/IpcMessages'
|
||||
@@ -127,7 +127,7 @@ export class HomeServerManager implements HomeServerManagerInterface {
|
||||
}
|
||||
|
||||
async startHomeServer(): Promise<string | undefined> {
|
||||
this.doNotInstantiateHomeServerOnWindowsUntilItIsSupported()
|
||||
await this.lazyLoadHomeServerOnApplicablePlatforms()
|
||||
|
||||
if (!this.homeServer) {
|
||||
return
|
||||
@@ -265,9 +265,17 @@ export class HomeServerManager implements HomeServerManagerInterface {
|
||||
return configuration
|
||||
}
|
||||
|
||||
private doNotInstantiateHomeServerOnWindowsUntilItIsSupported(): void {
|
||||
if (!isWindows() && !this.homeServer) {
|
||||
this.homeServer = new HomeServer()
|
||||
private async lazyLoadHomeServerOnApplicablePlatforms(): Promise<void> {
|
||||
if (isWindows()) {
|
||||
return
|
||||
}
|
||||
|
||||
if (this.homeServer) {
|
||||
return
|
||||
}
|
||||
|
||||
const { HomeServer } = await import('@standardnotes/home-server')
|
||||
|
||||
this.homeServer = new HomeServer()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,6 +61,7 @@ export async function createWindowState({
|
||||
const services = await createWindowServices(window, appState, appLocale)
|
||||
|
||||
require('@electron/remote/main').enable(window.webContents)
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
;(global as any).RemoteBridge = new RemoteBridge(
|
||||
window,
|
||||
Keychain,
|
||||
|
||||
Reference in New Issue
Block a user