From db26037c97c9b911e5ce21ff80e294a626850d8b Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Fri, 22 Nov 2024 15:54:36 -0300 Subject: [PATCH] fix: assure that all signers will have an unique id Without an unique ID, when do a delete will delete all that haven't an unique ID. By this way we assure that all will have an unique id Signed-off-by: Vitor Mattos --- src/store/files.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/store/files.js b/src/store/files.js index fa5e41d628..b900382f68 100644 --- a/src/store/files.js +++ b/src/store/files.js @@ -152,6 +152,7 @@ export const useFilesStore = function(...args) { }) }, async hydrateFile(nodeId) { + this.addUniqueIdentifierToAllSigners(this.files[nodeId].signers) if (Object.hasOwn(this.files[nodeId], 'uuid')) { return } @@ -173,6 +174,9 @@ export const useFilesStore = function(...args) { signers.map(signer => this.addIdentifierToSigner(signer)) }, addIdentifierToSigner(signer) { + if (signer.identify) { + return + } // generate unique code to new signer to be possible delete or edit if ((signer.identify === undefined || signer.identify === '') && signer.signRequestId === undefined) { signer.identify = btoa(String.fromCharCode(...new TextEncoder().encode(JSON.stringify(signer))))