From 885aa0bd23197b708a7ebfd5e5e04baab5278f4f Mon Sep 17 00:00:00 2001 From: Rohit Ranjan Date: Sun, 3 Dec 2023 19:53:46 +0530 Subject: [PATCH] fix UI nuiances --- plugin/src/hooks/useRemixClient.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/plugin/src/hooks/useRemixClient.ts b/plugin/src/hooks/useRemixClient.ts index 29323f95..3c5d7d85 100644 --- a/plugin/src/hooks/useRemixClient.ts +++ b/plugin/src/hooks/useRemixClient.ts @@ -38,6 +38,11 @@ const createExampleWorkspace = async (client: typeof remixClient): Promise `hello_world/${filePath}/${file.fileName}`, fileContent ) + } else if (file != null) { + await client.fileManager.writeFile( + `hello_world/${filePath}/${file.fileName}`, + fileContent + ) } } } catch (e) { @@ -187,6 +192,9 @@ const useRemixClient = (): { } ) + remixClient.on('fileManager', 'currentFileChanged', (_: any) => { + getAndSetTomlPaths(remixClient, currWorkspacePath, setTomlPaths).catch(e => { console.error(e) }) + }) remixClient.on('fileManager', 'fileAdded', (_: any) => { getAndSetTomlPaths(remixClient, currWorkspacePath, setTomlPaths).catch(e => { console.error(e) }) })