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>
This commit is contained in:
Christopher Ng 2023-01-10 19:51:14 +00:00 committed by Vincent Petry
parent 082fe16eee
commit e225b8d77d
No known key found for this signature in database
GPG key ID: E055D6A4D513575C
3 changed files with 13 additions and 6 deletions

View file

@ -644,7 +644,13 @@ export default {
if (this.share && !this.share.id) {
// if the share is valid, create it on the server
if (this.checkShare(this.share)) {
await this.pushNewLinkShare(this.share, true)
try {
await this.pushNewLinkShare(this.share, true)
} catch (e) {
this.pending = false
console.error(e)
return false
}
return true
} else {
this.open = true
@ -738,8 +744,8 @@ export default {
component.copyLink()
}
} catch ({ response }) {
const message = response.data.ocs.meta.message
} catch (data) {
const message = data.response.data.ocs.meta.message
if (message.match(/password/i)) {
this.onSyncError('password', message)
} else if (message.match(/date/i)) {
@ -747,6 +753,7 @@ export default {
} else {
this.onSyncError('pending', message)
}
throw data
} finally {
this.loading = false
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long