fix(import): apply layouts when connections already exist
This commit is contained in:
1 parent
71136377e5
commit
2f3a32955c
4 files changed
+264
-3
No files matched your search
@@ -2,6 +2,7 @@ import { ref, watch } from "vue";
|
||||
import { useI18n } from "vue-i18n";
|
||||
import { useConnectionStore } from "@/stores/connectionStore";
|
||||
import { useToast } from "@/composables/useToast";
|
||||
import { hasSidebarLayoutEntries } from "@/lib/sidebar/sidebarLayout";
|
||||
import type { SidebarLayout } from "@/types/database";
|
||||
|
||||
const showTransferDialog = ref(false);
|
||||
@@ -310,7 +311,7 @@ export function useDialogSources() {
|
||||
: t("configExport.importNone"),
|
||||
4000,
|
||||
);
|
||||
if (layout && count > 0) {
|
||||
if (hasSidebarLayoutEntries(layout)) {
|
||||
pendingImportLayout.value = layout;
|
||||
showImportLayoutConfirm.value = true;
|
||||
}
|
||||
@@ -325,7 +326,7 @@ export function useDialogSources() {
|
||||
const { count, layout } = await connectionStore.importConnectionsFromFile(pendingImportContent.value, passphrase);
|
||||
showConfigPassphraseDialog.value = false;
|
||||
toast(count > 0 ? t("configExport.importSuccess", { count }) : t("configExport.importNone"), 2000);
|
||||
if (layout && count > 0) {
|
||||
if (hasSidebarLayoutEntries(layout)) {
|
||||
pendingImportLayout.value = layout;
|
||||
showImportLayoutConfirm.value = true;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user