Cleanup of obsolete typing
This commit is contained in:
parent
7c049df2e4
commit
47c19fa8da
1 changed files with 7 additions and 9 deletions
|
|
@ -67,7 +67,7 @@ class WebsocketConnection {
|
|||
export let debugPanelWebview: vscode.Webview | undefined;
|
||||
export function setupDebugPanel(
|
||||
panel: vscode.WebviewPanel | vscode.WebviewView,
|
||||
sessionIdPromise: Promise<string> | string
|
||||
sessionIdPromise: Promise<string>
|
||||
): string {
|
||||
debugPanelWebview = panel.webview;
|
||||
panel.onDidDispose(() => {
|
||||
|
|
@ -180,16 +180,14 @@ export function setupDebugPanel(
|
|||
panel.webview.onDidReceiveMessage(async (data) => {
|
||||
switch (data.type) {
|
||||
case "onLoad": {
|
||||
let sessionId: string;
|
||||
if (typeof sessionIdPromise === "string") {
|
||||
sessionId = sessionIdPromise;
|
||||
} else {
|
||||
sessionId = await sessionIdPromise;
|
||||
}
|
||||
const sessionId = await sessionIdPromise;
|
||||
panel.webview.postMessage({
|
||||
type: "onLoad",
|
||||
vscMachineId: vscode.env.machineId,
|
||||
apiUrl: getContinueServerUrl(),
|
||||
workspacePaths: vscode.workspace.workspaceFolders?.map(
|
||||
(folder) => folder.uri.fsPath
|
||||
),
|
||||
sessionId,
|
||||
vscMediaUrl,
|
||||
dataSwitchOn: vscode.workspace
|
||||
|
|
@ -323,9 +321,9 @@ export class ContinueGUIWebviewViewProvider
|
|||
implements vscode.WebviewViewProvider
|
||||
{
|
||||
public static readonly viewType = "continue.continueGUIView";
|
||||
private readonly sessionIdPromise: Promise<string> | string;
|
||||
private readonly sessionIdPromise: Promise<string>;
|
||||
|
||||
constructor(sessionIdPromise: Promise<string> | string) {
|
||||
constructor(sessionIdPromise: Promise<string>) {
|
||||
this.sessionIdPromise = sessionIdPromise;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue