Skip to content

Commit

Permalink
fix(desktop): instantiate home server only upon starting
Browse files Browse the repository at this point in the history
  • Loading branch information
Karol Sójko committed Jul 4, 2023
1 parent 3df8be4 commit 3d3c7f7
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ export class HomeServerManager implements HomeServerManagerInterface {

private homeServer?: HomeServerInterface

constructor(private webContents: WebContents, private filesManager: FilesManagerInterface) {
this.doNotInstantiateHomeServerOnWindowsUntilItIsSupported()
}
constructor(private webContents: WebContents, private filesManager: FilesManagerInterface) {}

async getHomeServerUrl(): Promise<string | undefined> {
const homeServerConfiguration = await this.getHomeServerConfigurationObject()
Expand Down Expand Up @@ -129,6 +127,8 @@ export class HomeServerManager implements HomeServerManagerInterface {
}

async startHomeServer(): Promise<string | undefined> {
this.doNotInstantiateHomeServerOnWindowsUntilItIsSupported()

if (!this.homeServer) {
return
}
Expand Down Expand Up @@ -266,7 +266,7 @@ export class HomeServerManager implements HomeServerManagerInterface {
}

private doNotInstantiateHomeServerOnWindowsUntilItIsSupported(): void {
if (!isWindows()) {
if (!isWindows() && !this.homeServer) {
this.homeServer = new HomeServer()
}
}
Expand Down

0 comments on commit 3d3c7f7

Please sign in to comment.