Skip to content

Commit

Permalink
add transaction fetch details button (#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
zlayine authored Oct 4, 2023
1 parent c24f9ff commit 39570de
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 16 deletions.
17 changes: 1 addition & 16 deletions resources/js/components/WalletConnectButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ import snackbar from '~/util/snackbar';
const appStore = useAppStore();
const loading = ref(true);
const loading = ref(false);
const showAccountsModal = ref(false);
const walletSession = computed(() => appStore.wallet);
Expand All @@ -74,24 +74,9 @@ const connectWallet = async (provider: string) => {
}
};
const getSession = async () => {
try {
loading.value = true;
await appStore.getSession();
} catch (e) {
snackbar.error({ title: 'Failed to get session' });
} finally {
loading.value = false;
}
};
const disconnectWallet = async () => {
loading.value = true;
await appStore.disconnectWallet();
loading.value = false;
};
(async () => {
getSession();
})();
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,21 @@
Usually it takes few seconds to finilize the transaction
</div>
</div>
<div v-else-if="!webSocket" class="py-4">
<Btn
v-if="transaction?.state !== TransactionState.FINALIZED"
class="!mx-auto !flex"
primary
:loading="isLoading"
:disabled="isLoading"
@click="getTransaction"
>
Get More Transaction Details
</Btn>
<div class="text-xs text-center mx-auto mt-4">
Usually it takes few seconds to finilize the transaction
</div>
</div>
</template>
</div>

Expand Down
1 change: 1 addition & 0 deletions resources/js/store/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ export const useAppStore = defineStore('app', {
if (this.hasMarketplacePackage) this.addMarketplaceNavigation();

if (this.loggedIn) await this.getUser();
await this.getSession();

return await this.fetchCollectionIds();
} catch (error: any) {
Expand Down

0 comments on commit 39570de

Please sign in to comment.