From c63f3f63d101f797518ea1944ad4226bfee81841 Mon Sep 17 00:00:00 2001 From: atticusofsparta Date: Tue, 21 Jan 2025 19:46:19 -0600 Subject: [PATCH 1/4] fix(primary names): make primary names owner only workflow --- src/components/data-display/tables/DomainsTable.tsx | 7 +++++-- src/components/pages/ManageDomain/ManageDomain.tsx | 4 +++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/components/data-display/tables/DomainsTable.tsx b/src/components/data-display/tables/DomainsTable.tsx index 2b2e9f8eb..110b2518b 100644 --- a/src/components/data-display/tables/DomainsTable.tsx +++ b/src/components/data-display/tables/DomainsTable.tsx @@ -420,8 +420,10 @@ const DomainsTable = ({ (); From 3dc5c0c8a47c66b65e70ffa8a23a3d7f139f9d68 Mon Sep 17 00:00:00 2001 From: atticusofsparta Date: Wed, 22 Jan 2025 10:20:18 -0600 Subject: [PATCH 2/4] fix(primary name): check for wallet on primary name check for isOwner --- src/components/pages/ManageDomain/ManageDomain.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/pages/ManageDomain/ManageDomain.tsx b/src/components/pages/ManageDomain/ManageDomain.tsx index bc65ad6f0..2315d7163 100644 --- a/src/components/pages/ManageDomain/ManageDomain.tsx +++ b/src/components/pages/ManageDomain/ManageDomain.tsx @@ -23,7 +23,9 @@ function ManageDomain() { const { data: domainData } = useDomainInfo({ domain: name }); const [{ walletAddress }] = useWalletState(); - const isOwner = walletAddress?.toString() === domainData?.info?.Owner; + const isOwner = walletAddress + ? walletAddress?.toString() === domainData?.info?.Owner + : false; const [logoId, setLogoId] = useState(); From 32f64a3c6a78e229db12abdf2718d33e0fb73766 Mon Sep 17 00:00:00 2001 From: atticusofsparta Date: Wed, 22 Jan 2025 14:50:14 -0600 Subject: [PATCH 3/4] fix(button): do not render star for primary button if not owner --- .../data-display/tables/DomainsTable.tsx | 117 +++++++++--------- 1 file changed, 59 insertions(+), 58 deletions(-) diff --git a/src/components/data-display/tables/DomainsTable.tsx b/src/components/data-display/tables/DomainsTable.tsx index 110b2518b..998f11d14 100644 --- a/src/components/data-display/tables/DomainsTable.tsx +++ b/src/components/data-display/tables/DomainsTable.tsx @@ -418,68 +418,69 @@ const DomainsTable = ({ return (
- { - const targetName = row.getValue('name') as string; - if (primaryNameData?.name === targetName) { - // remove primary name payload - dispatchTransactionState({ - type: 'setTransactionData', - payload: { - names: [targetName], - arioProcessId, - assetId: row.getValue('processId'), - functionName: 'removePrimaryNames', - }, - }); - } else { - dispatchTransactionState({ - type: 'setTransactionData', - payload: { - name: targetName, - arioProcessId, - assetId: arioProcessId, - functionName: 'primaryNameRequest', - }, - }); + {row.getValue('role') === 'owner' ? ( + { + const targetName = row.getValue('name') as string; + if (primaryNameData?.name === targetName) { + // remove primary name payload + dispatchTransactionState({ + type: 'setTransactionData', + payload: { + names: [targetName], + arioProcessId, + assetId: row.getValue('processId'), + functionName: 'removePrimaryNames', + }, + }); + } else { + dispatchTransactionState({ + type: 'setTransactionData', + payload: { + name: targetName, + arioProcessId, + assetId: arioProcessId, + functionName: 'primaryNameRequest', + }, + }); + } - dispatchModalState({ - type: 'setModalOpen', - payload: { showPrimaryNameModal: true }, - }); - }} - > - + - - } - /> + } + /> + + } + /> + ) : ( + <> + )} Date: Wed, 22 Jan 2025 16:07:27 -0600 Subject: [PATCH 4/4] fix(nullish): remove null check --- src/components/pages/ManageDomain/ManageDomain.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/pages/ManageDomain/ManageDomain.tsx b/src/components/pages/ManageDomain/ManageDomain.tsx index 2315d7163..9f50526a7 100644 --- a/src/components/pages/ManageDomain/ManageDomain.tsx +++ b/src/components/pages/ManageDomain/ManageDomain.tsx @@ -24,7 +24,7 @@ function ManageDomain() { const [{ walletAddress }] = useWalletState(); const isOwner = walletAddress - ? walletAddress?.toString() === domainData?.info?.Owner + ? walletAddress.toString() === domainData?.info?.Owner : false; const [logoId, setLogoId] = useState();