Skip to content

Commit

Permalink
fix: not fetch skland cultivate after cred changed
Browse files Browse the repository at this point in the history
  • Loading branch information
Tsuk1ko committed Jul 7, 2024
1 parent 183c74a commit a7bdefc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/store/skland.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export const useSklandStore = defineStore('skland', () => {
token.value = '';
uid.value = '';
cultivateCharacters.value = {};
cultivateLastFetch = 0;
});

const refreshToken = async () => {
Expand Down Expand Up @@ -96,7 +97,7 @@ export const useSklandStore = defineStore('skland', () => {
};

const updateSklandCultivateIfExpired = async () => {
if (Date.now() - cultivateLastFetch < 1800e3 && cultivateCharacters.value) return;
if (Date.now() - cultivateLastFetch < 1800e3) return;
await fetchSklandCultivate();
};

Expand Down

0 comments on commit a7bdefc

Please sign in to comment.