Skip to content

Commit 8865548

Browse files
fix: preserve selection while sign sidebar stays open
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
1 parent f982c34 commit 8865548

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

src/views/FilesList/FilesList.vue

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@
9090
<script setup lang="ts">
9191
9292
import { t } from '@nextcloud/l10n'
93-
import { computed, getCurrentInstance, onBeforeUnmount, onMounted, ref } from 'vue'
93+
import { computed, onBeforeUnmount, onMounted, ref } from 'vue'
94+
import { useRoute } from 'vue-router'
9495
9596
import HomeSvg from '@mdi/svg/svg/home.svg?raw'
9697
import {
@@ -128,9 +129,7 @@ const filesStore = useFilesStore()
128129
const filtersStore = useFiltersStore()
129130
const userConfigStore = useUserConfigStore()
130131
const sidebarStore = useSidebarStore()
131-
132-
const instance = getCurrentInstance()
133-
const route = computed(() => instance?.proxy?.$route ?? { query: {} })
132+
const route = useRoute()
134133
135134
const isMenuOpen = ref(false)
136135
const loading = ref(true)
@@ -156,7 +155,7 @@ function toggleGridView() {
156155
}
157156
158157
function checkAndOpenFileFromUri() {
159-
const query = route.value.query as { uuid?: string | string[] }
158+
const query = route.query as { uuid?: string | string[] }
160159
const uuid = Array.isArray(query.uuid) ? query.uuid[0] : query.uuid
161160
if (uuid) {
162161
filesStore.selectFileByUuid(uuid).then((fileId) => {
@@ -175,7 +174,9 @@ onMounted(async () => {
175174
})
176175
177176
onBeforeUnmount(() => {
178-
filesStore.selectFile()
177+
if (!(sidebarStore.isVisible && sidebarStore.activeTab === 'sign-tab')) {
178+
filesStore.selectFile()
179+
}
179180
})
180181
181182
defineExpose({

0 commit comments

Comments
 (0)