Skip to content

Commit

Permalink
Merge pull request #9 from nextcloud/fix/topic-validation
Browse files Browse the repository at this point in the history
fix(SendFilesModal): fix topic condition and value for file submission
  • Loading branch information
edward-ly authored Aug 16, 2024
2 parents a450dac + 412fe0b commit dd0eefc
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/components/SendFilesModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -348,10 +348,15 @@ export default {
return this.files.filter((f) => f.type !== 'dir').length === 0
},
canValidate() {
return this.selectedChannel !== null
&& this.selectedTopic !== null
const isValid = this.selectedChannel !== null
&& (this.sendType !== SEND_TYPE.file.id || !this.onlyDirectories)
&& this.files.length > 0
if (this.selectedChannel?.type === 'channel') {
return isValid && this.selectedTopic !== null
}
return isValid
},
},
Expand Down Expand Up @@ -401,7 +406,7 @@ export default {
messageType: this.selectedChannel.type,
channelId: this.selectedChannel.channel_id ?? this.selectedChannel.user_id,
channelName: this.selectedChannel.name,
topicName: this.selectedTopic.name,
topicName: this.selectedTopic?.name ?? '',
type: this.sendType,
comment: this.comment,
permission: this.selectedPermission,
Expand Down

0 comments on commit dd0eefc

Please sign in to comment.