From 7dc96a8094492a07a0641dfefe8aaf56393017d6 Mon Sep 17 00:00:00 2001 From: paulober <44974737+paulober@users.noreply.github.com> Date: Thu, 9 May 2024 18:38:00 +0200 Subject: [PATCH] Fix #2, NewProjectPanel persistent state Signed-off-by: paulober <44974737+paulober@users.noreply.github.com> --- src/webview/newProjectPanel.mts | 10 +- web/main.js | 6 +- web/state.js | 419 ++++++++++++++++++++++++++++++++ 3 files changed, 430 insertions(+), 5 deletions(-) create mode 100644 web/state.js diff --git a/src/webview/newProjectPanel.mts b/src/webview/newProjectPanel.mts index 0a951307..a4625913 100644 --- a/src/webview/newProjectPanel.mts +++ b/src/webview/newProjectPanel.mts @@ -1174,6 +1174,9 @@ export class NewProjectPanel { const navScriptUri = webview.asWebviewUri( Uri.joinPath(this._extensionUri, "web", "nav.js") ); + const stateScriptUri = webview.asWebviewUri( + Uri.joinPath(this._extensionUri, "web", "state.js") + ); const tailwindcssScriptUri = webview.asWebviewUri( Uri.joinPath(this._extensionUri, "web", "tailwindcss-3_3_5.js") ); @@ -1513,7 +1516,11 @@ export class NewProjectPanel { !this._isProjectImport ? "C:\\MyProject" : "C:\\Project\\To\\Import" - }" disabled/> + }" disabled value="${ + this._projectRoot !== undefined + ? this._projectRoot.fsPath.replaceAll("\\", "/") + : "" + }"/>