Browse Source

fix: the problem of incorrect hint of opening developer option (#693)

master
wzrove 2 years ago committed by GitHub
parent
commit
acfc86f9f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 16
      src/components/Tools/Logo.vue

16
src/components/Tools/Logo.vue

@ -31,10 +31,14 @@ export default {
...mapActions(['refreshOptionsCache']),
onLogoClick: throttle(async function () {
this.clickCount++
if (this.clickCount === 10) {
if (this.options.developer_mode) {
this.$message.info(`当前已启用开发者选项!`)
this.clickCount = 0
} else if (this.clickCount < 10) {
this.$message.info(`再点击 ${10 - this.clickCount} 次即可启用开发者选项!`)
} else if (this.clickCount === 10) {
try {
await apiClient.option.saveMapView({ developer_mode: true })
await this.refreshOptionsCache()
this.$message.success(`开发者选项已启用!`)
this.clickCount = 0
@ -43,14 +47,8 @@ export default {
this.$log.error(e)
}
return
}
if (this.clickCount >= 5) {
if (this.options.developer_mode) {
this.$message.info(`当前已启用开发者选项!`)
this.clickCount = 0
} else {
this.$message.info(`再点击 ${10 - this.clickCount} 次即可启用开发者选项!`)
}
this.$message.info('正在启用开发者选项!')
}
}, 200)
}

Loading…
Cancel
Save