Skip to content
代码片段 群组 项目
提交 3b8cd385 编辑于 作者: Thomas Hutterer's avatar Thomas Hutterer
浏览文件

Rename updatePid to updateTimeoutId for clarity

上级 8e63b61b
No related branches found
No related tags found
无相关合并请求
...@@ -55,7 +55,7 @@ export default { ...@@ -55,7 +55,7 @@ export default {
}, },
data() { data() {
return { return {
updatePid: null, updateTimeoutId: null,
needsRefresh: false, needsRefresh: false,
cursor: { cursor: {
first: DEFAULT_PAGE_SIZE, first: DEFAULT_PAGE_SIZE,
...@@ -228,18 +228,18 @@ export default { ...@@ -228,18 +228,18 @@ export default {
this.showSpinnerWhileLoading = true; this.showSpinnerWhileLoading = true;
}, },
startedInteracting() { startedInteracting() {
clearTimeout(this.updatePid); clearTimeout(this.updateTimeoutId);
}, },
stoppedInteracting() { stoppedInteracting() {
if (!this.needsRefresh) { if (!this.needsRefresh) {
return; return;
} }
if (this.updatePid) { if (this.updateTimeoutId) {
clearTimeout(this.updatePid); clearTimeout(this.updateTimeoutId);
} }
this.updatePid = setTimeout(() => { this.updateTimeoutId = setTimeout(() => {
/* /*
We double-check needsRefresh or We double-check needsRefresh or
whether a query is already running whether a query is already running
...@@ -247,7 +247,7 @@ export default { ...@@ -247,7 +247,7 @@ export default {
if (this.needsRefresh && !this.$apollo.queries.todos.loading) { if (this.needsRefresh && !this.$apollo.queries.todos.loading) {
this.updateAllQueries(false); this.updateAllQueries(false);
} }
this.updatePid = null; this.updateTimeoutId = null;
}, TODO_WAIT_BEFORE_RELOAD); }, TODO_WAIT_BEFORE_RELOAD);
}, },
}, },
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册