-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from sefatanam/1-after-install-ui-not-working-w…
…indows feat: add default homepage loading configuration
- Loading branch information
Showing
10 changed files
with
152 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
export * from './command'; | ||
export * from './constant'; | ||
export * from './engine'; | ||
export * from './state'; | ||
export * from './store'; | ||
export * from './types'; | ||
export * from './views'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import * as vscode from 'vscode'; | ||
export class State { | ||
#data: { [key: string]: any } = {}; | ||
constructor() { | ||
if (State.instance) { | ||
vscode.window.showErrorMessage(`Pretty Home instance already running.`); | ||
} | ||
} | ||
get data() { | ||
return this.#data; | ||
} | ||
static instance: State; | ||
static { | ||
this.instance = new State(); | ||
} | ||
static getInstance() { | ||
return this.instance; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import * as vscode from 'vscode'; | ||
import { APP } from "./constant"; | ||
import { State } from "./state"; | ||
|
||
export function setWebviewReference(webviewPanel: vscode.WebviewPanel, state: State) { | ||
state.data[APP.WEB_VIEW_REF] = webviewPanel; | ||
} | ||
|
||
export function getWebviewReference(state: State): boolean { | ||
try { | ||
const windowRef: vscode.WebviewPanel = state.data[APP.WEB_VIEW_REF]; | ||
return windowRef.visible; | ||
} catch (_) { | ||
return false; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters