diff --git a/libs/remix-ui/home-tab/src/lib/remix-ui-home-tab.tsx b/libs/remix-ui/home-tab/src/lib/remix-ui-home-tab.tsx index 05f7c32125..2690dfc840 100644 --- a/libs/remix-ui/home-tab/src/lib/remix-ui-home-tab.tsx +++ b/libs/remix-ui/home-tab/src/lib/remix-ui-home-tab.tsx @@ -54,13 +54,16 @@ export const RemixUiHomeTab = (props: RemixUiHomeTabProps) => { contentImport.import( state.importSource, (loadingMsg) => dispatch({ tooltip: loadingMsg }), - (error, content, cleanUrl, type, url) => { + async (error, content, cleanUrl, type, url) => { if (error) { toast(error.message || error) } else { try { - workspace.addExternal(type + '/' + cleanUrl, content, url) - plugin.call('menuicons', 'select', 'filePanel') + if (await workspace.exists(type + '/' + cleanUrl)) toast('File already exists in workspace') + else { + workspace.addExternal(type + '/' + cleanUrl, content, url) + plugin.call('menuicons', 'select', 'filePanel') + } } catch (e) { toast(e.message) }