From 20abcbed5bfab6c5a8ad19462b9b726fd2d6490b Mon Sep 17 00:00:00 2001 From: Samuel Siegart Date: Tue, 21 Sep 2021 10:07:31 -0700 Subject: [PATCH] feat(wallet): Eagerly show pending state for approved offers (#3846) --- .../dapp-svelte-wallet/ui/src/TransactionV2.svelte | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/dapp-svelte-wallet/ui/src/TransactionV2.svelte b/packages/dapp-svelte-wallet/ui/src/TransactionV2.svelte index 29d98e78019..d9ae91500b5 100644 --- a/packages/dapp-svelte-wallet/ui/src/TransactionV2.svelte +++ b/packages/dapp-svelte-wallet/ui/src/TransactionV2.svelte @@ -12,6 +12,8 @@ export let item; export let dismiss; + let isPending = false; + function formatDateNow(stamp) { if (!stamp) { return "unknown time"; @@ -58,6 +60,11 @@ complete: "success", }; + const accept = () => { + isPending = true; + E(walletP).acceptOffer(offerId).catch(makeRejected('Cannot accept')); + } + $: ({ instancePetname, instanceHandleBoardId, @@ -68,7 +75,7 @@ proposalForDisplay: { give = {}, want = {} } = {}, } = item); - $: status = item.status || 'proposed'; + $: status = item.status || (isPending ? 'pending' : 'proposed');