@setoelkahfi / svara / commits / c848aa6

fix: tab context menu options disabled for new files with no path

Signed-off-by: mellobacon <mellodev@outlook.com>

mellobacon committed Nov 7, 2023 at 01:24 UTC c848aa6cdfafa1f427f5191d8bb0d0ee70d43844
1 file changed +2 -2
src/lib/Tab/Tab.svelte
+2 -2
@@ -23,8 +23,8 @@
23 let contextmenuitems = [
24 {name: "Close Tab", shortcut: commands.closeTab.keybind, action: () => {handleClose(id)}},
25 {name: "Close All Tabs", shortcut: "", action: commands.closeAllTabs.command},
26 - {name: "Open In Explorer", shortcut: commands.openInExplorer.keybind, action: () => {commands.openInExplorer.command(path)}},
27 - {name: "Rename File", shortcut: commands.renameFile.keybind, action: () => {commands.renameFile.command(label, path)}},
26 + {name: "Open In Explorer", disabled: path === label, shortcut: commands.openInExplorer.keybind, action: () => {commands.openInExplorer.command(path)}},
27 + {name: "Rename File", disabled: path === label, shortcut: commands.renameFile.keybind, action: () => {commands.renameFile.command(label, path)}},
28 ]
29 </script>
30 <div bind:this={tab} title={path} id={`editorTab-${id}`} class="tab" class:active={active}>