mirror of
https://github.com/documenso/documenso.git
synced 2026-07-26 18:04:55 +10:00
fix: prevent React state mutation by spreading envelope.recipients before sort (#2839)
This commit is contained in:
@@ -294,7 +294,7 @@ export const EnvelopeSigningProvider = ({
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const sortedRecipients = envelope.recipients.sort((a, b) => {
|
const sortedRecipients = [...envelope.recipients].sort((a, b) => {
|
||||||
// Sort by signingOrder first (nulls last), then by id
|
// Sort by signingOrder first (nulls last), then by id
|
||||||
if (a.signingOrder === null && b.signingOrder === null) {
|
if (a.signingOrder === null && b.signingOrder === null) {
|
||||||
return a.id - b.id;
|
return a.id - b.id;
|
||||||
|
|||||||
Reference in New Issue
Block a user