From c90dc082f1182041175ea01fda5bf6886383a0e0 Mon Sep 17 00:00:00 2001 From: Aditya Sharma <70089590+Aditya-eddy@users.noreply.github.com> Date: Mon, 7 Oct 2024 16:31:18 +0530 Subject: [PATCH] fix:correcting vscode api in the keployHome.svelete (#72) Signed-off-by: Aditya-eddy --- sidebar/sidebar.js | 17 ++++ webviews/components/KeployHome.svelte | 121 +++++++++++++------------- 2 files changed, 77 insertions(+), 61 deletions(-) diff --git a/sidebar/sidebar.js b/sidebar/sidebar.js index c06377f..7966832 100644 --- a/sidebar/sidebar.js +++ b/sidebar/sidebar.js @@ -132,6 +132,7 @@ if (rerunTestSuiteButton) { if(backConfigbutton){ backConfigbutton.addEventListener('click',async () =>{ + console.log("back button clicked man." , selectedIconButton.textContent); if(selectedIconButton.textContent == '1'){ console.log("selectedIconButton: " , selectedIconButton.textContent ); console.log("backconfig button clicked") @@ -418,6 +419,22 @@ document.addEventListener('addUsersClick', function (e) { } }); +// Listen for custom events from the Svelte component +document.addEventListener('getKeployConfig', () => { + vscode.postMessage({ + type: 'getKeployConfig', + }); +}); + +document.addEventListener('updateKeployConfig', (e) => { + const config = e.detail.config; + vscode.postMessage({ + type: 'updateKeployConfig', + config: config, + }); +}); + + // Handle messages sent from the extension window.addEventListener('message', event => { const message = event.data; diff --git a/webviews/components/KeployHome.svelte b/webviews/components/KeployHome.svelte index b74b246..e1c6cb9 100644 --- a/webviews/components/KeployHome.svelte +++ b/webviews/components/KeployHome.svelte @@ -1,37 +1,6 @@