Skip to content

Commit 28f5571

Browse files
committed
fix(Problem): 修复了当在设置中删除题目,且题目恰好显示在题目页面时的显示错误问题
1 parent 4eea037 commit 28f5571

File tree

5 files changed

+11
-27
lines changed

5 files changed

+11
-27
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
**注意:本系统仅减少拉取数据量,并非加速拉取**
1010

11-
[下载地址](https://github.com/Hukeqing/codeforces-client/releases/tag/v1.2.1)
11+
[下载地址](https://github.com/Hukeqing/codeforces-client/releases/tag/v1.2.2)
1212

1313
## 功能列表(括号内为实现此功能的版本号)
1414
- [x] 登录(>=0.1.0)

src/components/About.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export default {
4646
4747
data() {
4848
return {
49-
version: 'v1.2.1',
49+
version: 'v1.2.2',
5050
latestVersion: '',
5151
updateLink: '',
5252
}
@@ -72,4 +72,4 @@ export default {
7272

7373
<style scoped>
7474
75-
</style>
75+
</style>

src/components/Home.vue

+2-11
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,7 @@
7575
<ProblemSet v-show="status==='4-3'" v-on:proMessage="proMessage"></ProblemSet>
7676
<Problem v-show="status==='5'" :contestId="contestId" :problemId="problemId" :wat="watchAttr['5']"
7777
v-on:proMessage="proMessage"></Problem>
78-
<LocalManager v-if="status==='6'" :contestId="contestId" :problemId="problemId" v-on:proMessage="proMessage"
79-
v-on:reloadProblem="reloadProblem"></LocalManager>
78+
<LocalManager v-if="status==='6'" v-on:proMessage="proMessage"></LocalManager>
8079
<About v-show="status==='7'"></About>
8180
</el-main>
8281
</el-container>
@@ -115,11 +114,7 @@ export default {
115114
logout: '',
116115
contestId: '',
117116
problemId: '',
118-
watchAttr: {
119-
'2': false,
120-
'3': false,
121-
'4-2': false
122-
},
117+
watchAttr: {},
123118
}
124119
},
125120
@@ -155,10 +150,6 @@ export default {
155150
this.status = String(problem.next)
156151
this.watchAttr[problem.next] = true
157152
}
158-
},
159-
160-
reloadProblem() {
161-
this.watchAttr['5'] = true
162153
}
163154
}
164155
}

src/components/LocalManager.vue

+2-11
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
min-width="100">
2424
<template scope="scope">
2525
<el-link type="primary" v-on:click="clickProblem(scope.$index)">
26-
{{ problems[scope.$index].id }}
26+
{{ scope.row.id }}
2727
</el-link>
2828
</template>
2929
</el-table-column>
@@ -38,8 +38,7 @@
3838
align="center"
3939
min-width="50">
4040
<template scope="scope">
41-
<el-button type="primary"
42-
v-on:click="remove(scope.$index)">
41+
<el-button type="primary" v-on:click="remove(scope.$index)">
4342
删除缓存
4443
</el-button>
4544
</template>
@@ -71,11 +70,6 @@ export default {
7170
}
7271
},
7372
74-
props: {
75-
contestId: String,
76-
problemId: String,
77-
},
78-
7973
created() {
8074
this.loading = true
8175
@@ -122,10 +116,7 @@ export default {
122116
remove(index) {
123117
window.localStorage.removeItem(this.problems[index].id)
124118
window.localStorage.savedProblem = window.localStorage.savedProblem.replace(this.problems[index].id + ';', '')
125-
this.useLocalStorage = false
126119
this.problems.splice(index, 1)
127-
if (this.problems[index].id === this.contestId + this.problemId)
128-
this.$emit('reloadProblem')
129120
},
130121
131122
removeUser() {

src/components/Problem.vue

+4-2
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,10 @@ export default {
149149
window.localStorage.setItem(this.curCid + this.curPid, this.problemData)
150150
this.useLocalStorage = true
151151
} else {
152-
window.localStorage.removeItem(this.curCid + this.curPid)
153-
window.localStorage.savedProblem = window.localStorage.savedProblem.replace(this.curCid + this.curPid + ';', '')
152+
if (window.localStorage.getItem(this.curCid + this.curPid) != null) {
153+
window.localStorage.removeItem(this.curCid + this.curPid)
154+
window.localStorage.savedProblem = window.localStorage.savedProblem.replace(this.curCid + this.curPid + ';', '')
155+
}
154156
this.useLocalStorage = false
155157
}
156158
},

0 commit comments

Comments
 (0)