Skip to content

Commit

Permalink
fix: fetch presence status often
Browse files Browse the repository at this point in the history
  • Loading branch information
Bas950 committed Dec 23, 2023
1 parent f6a72d2 commit 527f931
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/components/StoreCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,9 @@
data() {
return {
cardHovered: false,
isInstalled: false,
isFetchingInstalled: false,
isPresenceInstalledInterval: null,
presenceLinkName: this.$props.presence.service
};
},
Expand All @@ -210,6 +213,19 @@
this.isPresenceInstalled(this.presence.service).then(response => {
if (response) this.isInstalled = true;
});
this.isPresenceInstalledInterval = setInterval(() => {
if (this.isFetchingInstalled) return;
this.isFetchingInstalled = true;
this.isPresenceInstalled(this.presence.service).then(response => {
if (response) this.isInstalled = true;
else this.isInstalled = false;
this.isFetchingInstalled = false;
});
}, 1000);
},
beforeDestroy() {
clearInterval(this.isPresenceInstalledInterval);
},
methods: {
like() {
Expand Down

0 comments on commit 527f931

Please sign in to comment.