Skip to content

Commit 36a9b58

Browse files
author
ci-bot
committed
fix duplicate workspace
1 parent d3fa766 commit 36a9b58

File tree

4 files changed

+2
-13
lines changed

4 files changed

+2
-13
lines changed

libs/remix-ui/top-bar/src/components/WorkspaceDropdown.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ export const WorkspacesDropdown: React.FC<WorkspacesDropdownProps> = ({ menuItem
121121
try {
122122
setTimeout(async () => {
123123
workspaces = await getWorkspaces()
124-
const updated = workspaces.map((workspace) => {
124+
const updated = (workspaces || []).map((workspace) => {
125125
(workspace as any).submenu = subItems
126126
return workspace as any
127127
})

libs/remix-ui/top-bar/src/context/topbarContext.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { createContext, SyntheticEvent } from 'react'
55
export const TopbarContext = createContext<{
66
fs: any,
77
plugin: Topbar,
8-
modal:(title: string | JSX.Element, message: string | JSX.Element, okLabel: string, okFn: () => void, cancelLabel?: string, cancelFn?: () => void) => void,
9-
dispatchInitWorkspace:() => Promise<void>,
8+
modal:(title: string | JSX.Element, message: string | JSX.Element, okLabel: string, okFn: () => void, cancelLabel?: string, cancelFn?: () => void) => void
109
}>(null)
1110

libs/remix-ui/top-bar/src/context/topbarProvider.tsx

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,6 @@ export const TopbarProvider = (props: TopbarProviderProps) => {
7676
const [focusToaster, setFocusToaster] = useState<string>('')
7777
const [toasters, setToasters] = useState<string[]>([])
7878

79-
const dispatchInitWorkspace = async () => {
80-
await initWorkspace(plugin.filePanel)(fsDispatch)
81-
}
82-
83-
useEffect(() => {
84-
dispatchInitWorkspace()
85-
}, [])
86-
8779
useEffect(() => {
8880
if (modals.length > 0) {
8981
setFocusModal(() => {
@@ -159,7 +151,6 @@ export const TopbarProvider = (props: TopbarProviderProps) => {
159151
plugin: plugin as unknown as Topbar,
160152
modal,
161153
toast,
162-
dispatchInitWorkspace,
163154
}
164155

165156
return (

libs/remix-ui/workspace/src/lib/contexts/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ export const FileSystemContext = createContext<{
99
fs: any,
1010
plugin: any,
1111
modal:(title: string | JSX.Element, message: string | JSX.Element, okLabel: string, okFn: () => void, cancelLabel?: string, cancelFn?: () => void) => void,
12-
dispatchInitWorkspace:() => Promise<void>,
1312
dispatchFetchDirectory:(path: string) => Promise<void>,
1413
dispatchAddInputField:(path: string, type: 'file' | 'folder') => Promise<void>,
1514
dispatchRemoveInputField:(path: string) => Promise<void>,

0 commit comments

Comments
 (0)