7171</template >
7272
7373<script lang="ts">
74+ import type { ConflictResolutionResult } from ' ../index.ts'
75+
76+ import { basename , extname } from ' path'
7477import { Node } from ' @nextcloud/files'
7578import { showError } from ' @nextcloud/dialogs'
79+ import Vue from ' vue'
80+
7681import NcButton from ' @nextcloud/vue/dist/Components/NcButton.js'
7782import NcCheckboxRadioSwitch from ' @nextcloud/vue/dist/Components/NcCheckboxRadioSwitch.js'
7883import NcModal from ' @nextcloud/vue/dist/Components/NcModal.js'
79- import Vue from ' vue'
80-
8184import ArrowRight from ' vue-material-design-icons/ArrowRight.vue'
8285import Close from ' vue-material-design-icons/Close.vue'
8386
8487import { n , t } from ' ../utils/l10n.ts'
8588import logger from ' ../utils/logger.ts'
8689import NodesPicker from ' ./NodesPicker.vue'
87- import { basename , extname } from ' path'
8890
8991export default Vue .extend ({
9092 name: ' ConflictPicker' ,
@@ -105,11 +107,18 @@ export default Vue.extend({
105107 default: ' ' ,
106108 },
107109
110+ /** All the existing files in the current directory */
111+ content: {
112+ type: Array as () => Node [],
113+ required: true ,
114+ },
115+
108116 /** Existing files to be replaced */
109117 conflicts: {
110118 type: Array as () => Node [],
111119 required: true ,
112120 },
121+
113122 /** New files being moved/uploaded */
114123 files: {
115124 type: Array as () => (Node | File )[],
@@ -222,7 +231,7 @@ export default Vue.extend({
222231 this .$emit (' submit' , {
223232 selected: [],
224233 renamed: [],
225- })
234+ } as ConflictResolutionResult )
226235 },
227236
228237 onSubmit() {
@@ -237,7 +246,7 @@ export default Vue.extend({
237246 }
238247
239248 const selectedOldNames = this .oldSelected .map ((node : Node ) => node .basename ) as string []
240- const directoryContent = this .conflicts .map ((node : Node ) => node .basename ) as string []
249+ const directoryContent = this .content .map ((node : Node ) => node .basename ) as string []
241250
242251 // Files that got selected twice (new and old) gets renamed
243252 const renamed = [] as (File | Node )[]
@@ -273,7 +282,7 @@ export default Vue.extend({
273282 this .$emit (' submit' , {
274283 selected ,
275284 renamed ,
276- })
285+ } as ConflictResolutionResult )
277286 },
278287
279288 /**
0 commit comments