From acfc86f9f3c52a137ab4ae0cff87f3eaf07914ef Mon Sep 17 00:00:00 2001 From: wzrove <88016243+wzrove@users.noreply.github.com> Date: Thu, 17 Nov 2022 10:52:06 +0800 Subject: [PATCH] fix: the problem of incorrect hint of opening developer option (#693) --- src/components/Tools/Logo.vue | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/components/Tools/Logo.vue b/src/components/Tools/Logo.vue index 33b2fd50..a14d73a6 100644 --- a/src/components/Tools/Logo.vue +++ b/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} 次即可启用开发者选项!`) - } + } else { + this.$message.info('正在启用开发者选项!') } }, 200) }