mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-04 15:10:06 +00:00
fix: address code review - add try/catch for dynamic import and filter user keybindings
Amp-Thread-ID: https://ampcode.com/threads/T-019c17e3-96d4-754b-8a41-9257d73720f1
This commit is contained in:
@@ -126,6 +126,12 @@ export function useKeybindingService() {
|
||||
}
|
||||
const newBindings = settingStore.get('Comfy.Keybinding.NewBindings')
|
||||
for (const keybinding of newBindings) {
|
||||
if (
|
||||
isCloud &&
|
||||
keybinding.commandId === 'Workspace.ToggleBottomPanelTab.logs-terminal'
|
||||
) {
|
||||
continue
|
||||
}
|
||||
keybindingStore.addUserKeybinding(new KeybindingImpl(keybinding))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -121,11 +121,15 @@ export const useBottomPanelStore = defineStore('bottomPanel', () => {
|
||||
const registerCoreBottomPanelTabs = async () => {
|
||||
// Use __DISTRIBUTION__ directly for proper dead code elimination
|
||||
if (__DISTRIBUTION__ !== 'cloud') {
|
||||
const { useLogsTerminalTab, useCommandTerminalTab } =
|
||||
await import('@/composables/bottomPanelTabs/useTerminalTabs')
|
||||
registerBottomPanelTab(useLogsTerminalTab())
|
||||
if (isElectron()) {
|
||||
registerBottomPanelTab(useCommandTerminalTab())
|
||||
try {
|
||||
const { useLogsTerminalTab, useCommandTerminalTab } =
|
||||
await import('@/composables/bottomPanelTabs/useTerminalTabs')
|
||||
registerBottomPanelTab(useLogsTerminalTab())
|
||||
if (isElectron()) {
|
||||
registerBottomPanelTab(useCommandTerminalTab())
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Failed to load terminal tabs:', error)
|
||||
}
|
||||
}
|
||||
useShortcutsTab().forEach(registerBottomPanelTab)
|
||||
|
||||
Reference in New Issue
Block a user