Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hotfix: clear promise call #116

Merged
merged 2 commits into from
May 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions resources/js/components/beam/BeamsList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,7 @@ const openTransactionSlide = async (transactionId: string) => {

onMounted(async () => {
await appStore.initPromise;
useAppStore().clearInitPromise();
getBeams();
loadMoreItemsWithObserver();
events.on('transaction', openTransactionSlide);
Expand Down
1 change: 1 addition & 0 deletions resources/js/components/beam/ClaimsList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ const closeModalSlide = () => {

(async () => {
await useAppStore().initPromise;
useAppStore().clearInitPromise();
await getClaims();
})();

Expand Down
1 change: 1 addition & 0 deletions resources/js/components/marketplace/BidsList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ const closeModalSlide = () => {

(async () => {
await useAppStore().initPromise;
useAppStore().clearInitPromise();
await getBids();
})();

Expand Down
1 change: 1 addition & 0 deletions resources/js/components/marketplace/ListingsList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@ const closeModalSlide = () => {

(async () => {
await useAppStore().initPromise;
useAppStore().clearInitPromise();
await getListings();
})();

Expand Down
1 change: 1 addition & 0 deletions resources/js/components/marketplace/SalesList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ const closeModalSlide = () => {

(async () => {
await useAppStore().initPromise;
useAppStore().clearInitPromise();
await getSales();
})();

Expand Down
1 change: 1 addition & 0 deletions resources/js/components/pages/Collections.vue
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@ const openTransactionSlide = async (transactionId: string) => {

(async () => {
await useAppStore().initPromise;
useAppStore().clearInitPromise();
await getCollections();
})();

Expand Down
1 change: 1 addition & 0 deletions resources/js/components/pages/FuelTanks.vue
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@ const openTransactionSlide = async (transactionId: string) => {

(async () => {
await useAppStore().initPromise;
useAppStore().clearInitPromise();
await getFuelTanks();
})();

Expand Down
1 change: 1 addition & 0 deletions resources/js/components/pages/Tokens.vue
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,7 @@ const openTransactionSlide = async (transactionId: string) => {

onMounted(async () => {
await useAppStore().initPromise;
useAppStore().clearInitPromise();
getTokens();
loadMoreTokensWithObserver();
events.on('transaction', openTransactionSlide);
Expand Down
1 change: 1 addition & 0 deletions resources/js/components/pages/Transactions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,7 @@ const closeModalSlide = () => {

(async () => {
await useAppStore().initPromise;
useAppStore().clearInitPromise();
getTransactions();
})();

Expand Down
1 change: 1 addition & 0 deletions resources/js/components/pages/Wallets.vue
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@ const openTransactionSlide = async (transactionId: string) => {

onMounted(async () => {
await useAppStore().initPromise;
useAppStore().clearInitPromise();
getWallets();
loadMoreItemsWithObserver();
events.on('transaction', openTransactionSlide);
Expand Down
1 change: 1 addition & 0 deletions resources/js/components/pages/auth/Login.vue
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ const login = async (recaptcha?: string) => {
}
appStore.init();
await appStore.initPromise;
appStore.clearInitPromise();
if (appStore.loggedIn) {
snackbar.success({ title: 'Logged in successfully', save: false });
if (appStore.hasValidConfig) {
Expand Down
7 changes: 7 additions & 0 deletions resources/js/store/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ export const useAppStore = defineStore('app', {
try {
// eslint-disable-next-line
this.initPromise = new Promise(async (resolve) => {
if (this.config.network) {
return;
}

this.setConfig();

if (!this.config.url) {
Expand Down Expand Up @@ -281,6 +285,9 @@ export const useAppStore = defineStore('app', {
setTheme(theme: 'dark' | 'light') {
this.theme = theme;
},
clearInitPromise() {
this.initPromise = null;
},
},
getters: {
hasValidConfig(state: AppState) {
Expand Down
Loading