From 6edb5ac729672e83ff4bc48f0182caeec43b4efd Mon Sep 17 00:00:00 2001 From: Nope X Date: Sun, 2 Oct 2022 09:49:07 -0700 Subject: [PATCH] some basic sorting --- src/components/Multisig.tsx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/components/Multisig.tsx b/src/components/Multisig.tsx index cb83e6c..4ff7e6d 100644 --- a/src/components/Multisig.tsx +++ b/src/components/Multisig.tsx @@ -125,6 +125,17 @@ export function MultisigInstance({ multisig }: { multisig: PublicKey }) { }, [multisig, multisigClient.account]); useEffect(() => { multisigClient.account.transaction.all(multisig.toBuffer()).then((txs) => { + txs.sort((a,b)=>{ + // old owner sets too the bottom since not even executable + if (a.account.ownerSetSeqno != b.account.ownerSetSeqno){ + return b.account.ownerSetSeqno - a.account.ownerSetSeqno; + } + // unexecuted to the top since more relevant + if (a.account.didExecute != b.account.didExecute) { + return a.account.didExecute - b.account.didExecute; + } + return 0; + }); setTransactions(txs); }); }, [multisigClient.account.transaction, multisig, forceRefresh]);