From 9d8b7eeeba912e9a9cadc3a39edaa2513c62a1e0 Mon Sep 17 00:00:00 2001 From: lianahus Date: Wed, 20 Jul 2022 12:10:19 +0200 Subject: [PATCH] fixing null workspace --- apps/remix-ide/src/app/panels/file-panel.js | 2 +- libs/remix-ui/search/src/lib/context/context.tsx | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/remix-ide/src/app/panels/file-panel.js b/apps/remix-ide/src/app/panels/file-panel.js index ba45ff806b..e24b137058 100644 --- a/apps/remix-ide/src/app/panels/file-panel.js +++ b/apps/remix-ide/src/app/panels/file-panel.js @@ -57,7 +57,7 @@ module.exports = class Filepanel extends ViewPlugin { this.slitherHandle = new SlitherHandle() this.workspaces = [] this.appManager = appManager - this.currentWorkspaceMetadata = {} + this.currentWorkspaceMetadata = null } render () { diff --git a/libs/remix-ui/search/src/lib/context/context.tsx b/libs/remix-ui/search/src/lib/context/context.tsx index 9af59cce28..2b372a24c8 100644 --- a/libs/remix-ui/search/src/lib/context/context.tsx +++ b/libs/remix-ui/search/src/lib/context/context.tsx @@ -338,8 +338,10 @@ export const SearchProvider = ({ async function fetchWorkspace() { try { const workspace = await plugin.call('filePanel', 'getCurrentWorkspace') - if (workspace) value.setCurrentWorkspace(workspace.name) - setFiles(await getDirectory('/', plugin)) + if (workspace) { + value.setCurrentWorkspace(workspace.name) + setFiles(await getDirectory('/', plugin)) + } } catch (e) { console.log(e) }