Skip to content

Commit e618ad9

Browse files
committed
approaching new release, test fixes
1 parent 39d077b commit e618ad9

File tree

2 files changed

+29
-7
lines changed

2 files changed

+29
-7
lines changed

actions/OpenAllInMenuAction.vue

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@
1818
clickable
1919
v-close-popup
2020
@click="startAutoSwitchingTab(props.tabset.id)">
21-
<q-item-section>switching tab</q-item-section>
21+
<q-item-section>switching tab...</q-item-section>
2222
</q-item>
2323
<q-item dense clickable v-close-popup @click="restoreInNewWindow(props.tabset.id)">
2424
<q-item-section>new window</q-item-section>
2525
</q-item>
2626
<q-item dense clickable v-close-popup @click="restoreInGroup(props.tabset.id)">
27-
<q-item-section>this window</q-item-section>
27+
<q-item-section>this window...</q-item-section>
2828
</q-item>
2929
</q-list>
3030
</q-menu>
@@ -41,7 +41,8 @@
4141
</template>
4242
</template>
4343
<script setup lang="ts">
44-
import { LocalStorage } from 'quasar'
44+
import { LocalStorage, useQuasar } from 'quasar'
45+
import BrowserApi from 'src/app/BrowserApi'
4546
import { FeatureIdent } from 'src/app/models/FeatureIdent'
4647
import ContextMenuItem from 'src/core/components/helper/ContextMenuItem.vue'
4748
import { useCommandExecutor } from 'src/core/services/CommandExecutor'
@@ -56,6 +57,8 @@ const props = defineProps<ActionProps>()
5657
5758
const { inBexMode } = useUtils()
5859
60+
const $q = useQuasar()
61+
5962
const startAutoSwitchingTab = (tabsetId: string) => {
6063
const tabset = useTabsetsStore().getTabset(tabsetId)
6164
if (tabset && tabset.tabs?.length > 1 && tabset.tabs[0]!.url) {
@@ -87,6 +90,25 @@ const startAutoSwitchingTab = (tabsetId: string) => {
8790
const restoreInNewWindow = (tabsetId: string, windowName: string | undefined = undefined) =>
8891
useCommandExecutor().execute(new RestoreTabsetCommand(tabsetId, windowName))
8992
90-
const restoreInGroup = (tabsetId: string, windowName: string | undefined = undefined) =>
91-
useCommandExecutor().execute(new RestoreTabsetCommand(tabsetId, windowName, false))
93+
const restoreInGroup = (tabsetId: string, windowName: string | undefined = undefined) => {
94+
$q.dialog({
95+
title: 'Open tabset in this window',
96+
message: 'Should the current tabs be closed? (Pinned tabs will be kept)',
97+
options: {
98+
type: 'checkbox',
99+
model: [],
100+
items: [{ label: 'close current tabs', value: 'true', color: 'secondary' }],
101+
},
102+
cancel: true,
103+
}).onOk((data: any) => {
104+
if (data![0] === 'true') {
105+
console.log('data', data)
106+
BrowserApi.closeAllTabs(false).then(() => {
107+
useCommandExecutor().execute(new RestoreTabsetCommand(tabsetId, windowName, false))
108+
})
109+
} else {
110+
useCommandExecutor().execute(new RestoreTabsetCommand(tabsetId, windowName, false))
111+
}
112+
})
113+
}
92114
</script>

commands/RestoreTabset.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import ChromeApi from 'src/app/BrowserApi'
1+
import BrowserApi from 'src/app/BrowserApi'
22
import Command from 'src/core/domain/Command'
33
import { ExecutionResult } from 'src/core/domain/ExecutionResult'
44
import { useTabsetsStore } from 'src/tabsets/stores/tabsetsStore'
@@ -18,7 +18,7 @@ export class RestoreTabsetCommand implements Command<string> {
1818
const tabset = useTabsetsStore().getTabset(this.tabsetId)
1919
if (tabset) {
2020
//console.log('found tabset for id', this.tabsetId)
21-
ChromeApi.restore(tabset, this.windowName, this.inNewWindow)
21+
BrowserApi.restore(tabset, this.windowName, this.inNewWindow)
2222
return new ExecutionResult('result', 'doneMsg')
2323
}
2424
return Promise.reject('could not find tabset')

0 commit comments

Comments
 (0)