Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -197,11 +197,14 @@ export default defineComponent({
},

data() {
const destination = (this.context.permissions & Permission.SHARE)
? this.context.path
: '/'
return {
currentStep: STEP.FIRST,
loading: false,

destination: this.context.path || '/',
destination,
label: '',
note: '',

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,11 @@
</template>

<script lang="ts">
import type { Folder, Node } from '@nextcloud/files'
import type { Folder, INode } from '@nextcloud/files'
import type { PropType } from 'vue'

import { getFilePickerBuilder } from '@nextcloud/dialogs'
import { Permission } from '@nextcloud/files'
import { t } from '@nextcloud/l10n'
import { defineComponent } from 'vue'
import NcTextArea from '@nextcloud/vue/components/NcTextArea'
Expand Down Expand Up @@ -146,6 +147,7 @@ export default defineComponent({
callback: this.onPickedDestination,
})
.setFilter((node) => node.path !== '/')
.setCanPick((node) => Boolean(node.permissions & Permission.SHARE))
.startAt(this.destination)
.build()
try {
Expand All @@ -155,7 +157,7 @@ export default defineComponent({
}
},

onPickedDestination(nodes: Node[]) {
onPickedDestination(nodes: INode[]) {
const node = nodes[0]
if (node) {
this.$emit('update:destination', node.path)
Expand Down
Loading