Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cypress/support/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import './commands'
// eslint-disable-next-line n/no-extraneous-import
import 'core-js/stable/index.js'

import { mount } from '@cypress/vue2'
import { mount } from '@cypress/vue'

// @ts-expect-error Mock window so this is an internal property
window._oc_capabilities = { files: {} }
Expand Down
22 changes: 11 additions & 11 deletions lib/dialogs/openConflictPicker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
*/

import type { Node } from '@nextcloud/files'
import type { AsyncComponent } from 'vue'

import Vue, { defineAsyncComponent } from 'vue'
import { createApp, defineAsyncComponent, h } from 'vue'

export type ConflictResolutionResult<T extends File|FileSystemEntry|Node> = {
selected: T[],
Expand Down Expand Up @@ -36,10 +34,12 @@ export async function openConflictPicker<T extends File|FileSystemEntry|Node>(
options?: ConflictPickerOptions,
): Promise<ConflictResolutionResult<T>> {
const ConflictPicker = defineAsyncComponent(() => import('./components/ConflictPicker.vue')) as AsyncComponent
const container = document.createElement('div')

return new Promise((resolve, reject) => {
const picker = new Vue({
const picker = createApp({
name: 'ConflictPickerRoot',
render: (h) => h(ConflictPicker, {
render: () => h(ConflictPicker, {
props: {
dirname,
conflicts,
Expand All @@ -52,23 +52,23 @@ export async function openConflictPicker<T extends File|FileSystemEntry|Node>(
resolve(results)

// Destroy the component
picker.$destroy()
picker.$el?.parentNode?.removeChild(picker.$el)
picker.unmount()
document.body?.removeChild(container)
},
cancel(error?: Error) {
// Reject the promise
reject(error ?? new Error('Canceled'))

// Destroy the component
picker.$destroy()
picker.$el?.parentNode?.removeChild(picker.$el)
picker.unmount()
document.body?.removeChild(container)
},
},
}),
})

// Mount the component
picker.$mount()
document.body.appendChild(picker.$el)
document.body.appendChild(container)
picker.mount(container)
})
}
2 changes: 1 addition & 1 deletion lib/dialogs/utils/dialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import type { InvalidFilenameError } from '@nextcloud/files'

import { spawnDialog } from '@nextcloud/dialogs'
import { spawnDialog } from '@nextcloud/vue/functions/dialog'
import { validateFilename } from '@nextcloud/files'
import { defineAsyncComponent } from 'vue'

Expand Down
Loading
Loading