Skip to content

Commit

Permalink
fix: clear timer on beforeunmount
Browse files Browse the repository at this point in the history
  • Loading branch information
gamalielhere committed Feb 18, 2025
1 parent 83016bb commit ae60c12
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

<script setup lang="ts">
import BalanceLoader from '@action/icons/common/balance-loader.vue';
import { ref, watchEffect } from 'vue';
import { onBeforeMount, ref, watchEffect } from 'vue';
const props = defineProps({
cryptoAmount: {
Expand Down Expand Up @@ -59,6 +59,12 @@ watchEffect(() => {
}, 30000);
}
});
onBeforeMount(() => {
if (timer) {
clearTimeout(timer);
}
});
</script>

<style lang="less">
Expand Down

0 comments on commit ae60c12

Please sign in to comment.