fix(files_sharing): apply link share password on first save

Pre-declare newPassword on the share state so Vue 2's reactivity covers
it from the start. Without this, $set later relies on a
property-addition notification path that races with the toggle's async
setter and intermittently drops the password in certain build
environments.

Fixes: #57011
-e
Signed-off-by: Peter Ringelmann <peter.ringelmann@nextcloud.com>
This commit is contained in:
Peter Ringelmann 2026-05-11 21:05:19 +02:00
parent ac15544703
commit f96cf79348
9 changed files with 28 additions and 12 deletions

View file

@ -39,6 +39,10 @@ export default class Share {
}
ocsData.attributes = ocsData.attributes ?? []
// Pre-declared so Vue 2 makes newPassword reactive at observation time,
// avoiding $set's property-addition path which races with async setters.
ocsData.newPassword = ocsData.newPassword ?? undefined
// store state
this._share = ocsData
}
@ -281,6 +285,18 @@ export default class Share {
this._share.password = password
}
/**
* Unsaved password (set during share creation or editing).
* Delegates to _share so reads/writes go through the reactive state.
*/
get newPassword(): string | undefined {
return this._share.newPassword
}
set newPassword(value: string | undefined) {
this._share.newPassword = value
}
/**
* Password expiration time
*

4
dist/1598-1598.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

4
dist/5638-5638.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long