You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2022/06/14 14:49:50 UTC
[GitHub] [skywalking-booster-ui] Fine0830 commented on a diff in pull request #108: fix:clear interval fail when close autoRefresh
Fine0830 commented on code in PR #108:
URL: https://github.com/apache/skywalking-booster-ui/pull/108#discussion_r896920837
##########
src/views/Settings.vue:
##########
@@ -101,23 +98,23 @@ const handleAuto = () => {
appStore.setAutoRefresh(auto.value);
if (auto.value) {
handleReload();
- state.timer = setInterval(handleReload, autoTime.value * 1000);
+ appStore.setReloadTimer(setInterval(handleReload, autoTime.value * 1000));
} else {
- if (state.timer) {
- clearInterval(state.timer);
+ if (appStore._reloadTimer) {
Review Comment:
You should use `appStore.reloadTimer`.
##########
src/store/modules/app.ts:
##########
@@ -53,8 +54,12 @@ export const appStore = defineStore({
pageTitle: "",
version: "",
isMobile: false,
+ reloadTimer: null,
}),
getters: {
+ _reloadTimer(): any {
Review Comment:
I don't think we need this here.
##########
src/views/Settings.vue:
##########
@@ -101,23 +98,23 @@ const handleAuto = () => {
appStore.setAutoRefresh(auto.value);
if (auto.value) {
handleReload();
- state.timer = setInterval(handleReload, autoTime.value * 1000);
+ appStore.setReloadTimer(setInterval(handleReload, autoTime.value * 1000));
} else {
- if (state.timer) {
- clearInterval(state.timer);
+ if (appStore._reloadTimer) {
+ clearInterval(appStore._reloadTimer);
Review Comment:
Same problem as above.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org