|
29 | 29 | <script lang="ts"> |
30 | 30 | import type { Folder } from '@nextcloud/files' |
31 | 31 | import type { PropType } from 'vue' |
32 | | -import type { RawLocation } from 'vue-router' |
33 | 32 |
|
34 | 33 | import { showError } from '@nextcloud/dialogs' |
35 | 34 | import { Permission } from '@nextcloud/files' |
@@ -111,7 +110,7 @@ export default defineComponent({ |
111 | 110 | mainContent.addEventListener('drop', this.onContentDrop) |
112 | 111 | }, |
113 | 112 |
|
114 | | - beforeDestroy() { |
| 113 | + beforeUnmount() { |
115 | 114 | const mainContent = window.document.getElementById('app-content-vue') as HTMLElement |
116 | 115 | mainContent.removeEventListener('dragover', this.onDragOver) |
117 | 116 | mainContent.removeEventListener('dragleave', this.onDragLeave) |
@@ -204,16 +203,19 @@ export default defineComponent({ |
204 | 203 | && upload.source.replace(folder.source, '').split('/').length === 2) |
205 | 204 |
|
206 | 205 | if (lastUpload !== undefined) { |
| 206 | + const fileid = String(lastUpload.response!.headers['oc-fileid']).split(/(oc|nc)/, 2)[0]! |
207 | 207 | logger.debug('Scrolling to last upload in current folder', { lastUpload }) |
208 | | - const location: RawLocation = { |
209 | | - path: this.$route.path, |
210 | | - // Keep params but change file id |
| 208 | + this.$router.push({ |
| 209 | + name: this.$route.name!, |
211 | 210 | params: { |
| 211 | + // Keep params but change file id |
212 | 212 | ...this.$route.params, |
213 | | - fileid: String(lastUpload.response!.headers['oc-fileid']), |
| 213 | + fileid, |
214 | 214 | }, |
215 | | - } |
216 | | - this.$router.push(location) |
| 215 | + query: { |
| 216 | + dir: this.$route.query.dir, |
| 217 | + }, |
| 218 | + }) |
217 | 219 | } |
218 | 220 |
|
219 | 221 | this.dragover = false |
|
0 commit comments