From 59cdacc0521defc0d99fb87b4d530d2b8d5288e1 Mon Sep 17 00:00:00 2001 From: Louis Lam Date: Fri, 18 Mar 2022 12:39:48 +0800 Subject: [PATCH] [Status Page] Enable Edit Mode only if the token is presented --- src/assets/app.scss | 4 ++++ src/pages/AddStatusPage.vue | 2 +- src/pages/StatusPage.vue | 8 +++++--- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/assets/app.scss b/src/assets/app.scss index 7378f52c8..b999da9d2 100644 --- a/src/assets/app.scss +++ b/src/assets/app.scss @@ -148,6 +148,10 @@ textarea.form-control { background-color: #090c10; color: $dark-font-color; + mark, .mark { + background-color: #b6ad86; + } + &::-webkit-scrollbar-thumb, ::-webkit-scrollbar-thumb { background: $dark-border-color; } diff --git a/src/pages/AddStatusPage.vue b/src/pages/AddStatusPage.vue index dd1099916..59c21ee95 100644 --- a/src/pages/AddStatusPage.vue +++ b/src/pages/AddStatusPage.vue @@ -56,7 +56,7 @@ export default { this.processing = false; if (res.ok) { - this.$router.push("/status/" + this.slug + "?edit"); + location.href = "/status/" + this.slug + "?edit"; } else { if (res.msg.includes("UNIQUE constraint")) { diff --git a/src/pages/StatusPage.vue b/src/pages/StatusPage.vue index 72da70b69..935e6ac00 100644 --- a/src/pages/StatusPage.vue +++ b/src/pages/StatusPage.vue @@ -498,9 +498,11 @@ export default { }, edit() { - this.$root.initSocketIO(true); - this.enableEditMode = true; - this.clickedEditButton = true; + if (this.hasToken) { + this.$root.initSocketIO(true); + this.enableEditMode = true; + this.clickedEditButton = true; + } }, save() {