diff --git a/apps/files_sharing/src/models/Share.ts b/apps/files_sharing/src/models/Share.ts index 8db50dd42fe..2022ca544c5 100644 --- a/apps/files_sharing/src/models/Share.ts +++ b/apps/files_sharing/src/models/Share.ts @@ -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 *