Skip to content

Commit 5421969

Browse files
Pytalnextcloud-command
authored andcommitted
Fix inability to re-enter share password after invalid input
Signed-off-by: Christopher Ng <chrng8@gmail.com> Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
1 parent 151f719 commit 5421969

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

apps/files_sharing/src/components/SharingEntryLink.vue

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,13 @@ export default {
644644
if (this.share && !this.share.id) {
645645
// if the share is valid, create it on the server
646646
if (this.checkShare(this.share)) {
647-
await this.pushNewLinkShare(this.share, true)
647+
try {
648+
await this.pushNewLinkShare(this.share, true)
649+
} catch (e) {
650+
this.pending = false
651+
console.error(e)
652+
return false
653+
}
648654
return true
649655
} else {
650656
this.open = true
@@ -738,15 +744,16 @@ export default {
738744
component.copyLink()
739745
}
740746
741-
} catch ({ response }) {
742-
const message = response.data.ocs.meta.message
747+
} catch (data) {
748+
const message = data.response.data.ocs.meta.message
743749
if (message.match(/password/i)) {
744750
this.onSyncError('password', message)
745751
} else if (message.match(/date/i)) {
746752
this.onSyncError('expireDate', message)
747753
} else {
748754
this.onSyncError('pending', message)
749755
}
756+
throw data
750757
} finally {
751758
this.loading = false
752759
}

dist/files_sharing-files_sharing_tab.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/files_sharing-files_sharing_tab.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)