mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-24 00:16:00 +00:00
set tab preview mode off in markTabUnsaved
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
export let tabid;
|
||||
export let tabVisible;
|
||||
export let tabFocused;
|
||||
export let tabPreviewMode;
|
||||
export let tabComponent;
|
||||
|
||||
setContext('tabid', tabid);
|
||||
@@ -19,7 +20,7 @@
|
||||
</script>
|
||||
|
||||
<div class:tabVisible>
|
||||
<svelte:component this={tabComponent} {...$$restProps} {tabid} {tabVisible} {tabFocused} />
|
||||
<svelte:component this={tabComponent} {...$$restProps} {tabid} {tabVisible} {tabFocused} {tabPreviewMode} />
|
||||
</div>
|
||||
|
||||
<style>
|
||||
|
||||
@@ -53,5 +53,6 @@
|
||||
unsaved={openedTabsByTabId[tabid]?.unsaved}
|
||||
tabVisible={tabid == shownTab?.tabid}
|
||||
tabFocused={tabid == shownTab?.tabid && shownTab?.focused}
|
||||
tabPreviewMode={tabid == shownTab?.tabid && shownTab?.tabPreviewMode}
|
||||
/>
|
||||
{/each}
|
||||
|
||||
@@ -23,7 +23,9 @@ export function changeTab(tabid, changeFunc) {
|
||||
export function markTabUnsaved(tabid) {
|
||||
const tab = getOpenedTabs().find(x => x.tabid == tabid);
|
||||
if (tab.unsaved) return;
|
||||
openedTabs.update(files => files.map(tab => (tab.tabid == tabid ? { ...tab, unsaved: true } : tab)));
|
||||
openedTabs.update(files =>
|
||||
files.map(tab => (tab.tabid == tabid ? { ...tab, unsaved: true, tabPreviewMode: false } : tab))
|
||||
);
|
||||
}
|
||||
|
||||
export function markTabSaved(tabid) {
|
||||
|
||||
Reference in New Issue
Block a user