From f030487f7d3bab7cf859ba21d0bfca3f437f9a2a Mon Sep 17 00:00:00 2001 From: Louis Lam Date: Sun, 10 Apr 2022 13:46:00 +0800 Subject: [PATCH] Fix theme color that do not apply to status page with a custom domain --- src/mixins/theme.js | 5 +++++ src/pages/Entry.vue | 1 + 2 files changed, 6 insertions(+) diff --git a/src/mixins/theme.js b/src/mixins/theme.js index fc593eb0d..21ebd0916 100644 --- a/src/mixins/theme.js +++ b/src/mixins/theme.js @@ -6,6 +6,7 @@ export default { userTheme: localStorage.theme, userHeartbeatBar: localStorage.heartbeatBarTheme, statusPageTheme: "light", + forceStatusPageTheme: false, path: "", }; }, @@ -27,6 +28,10 @@ export default { computed: { theme() { + // As entry can be status page now, set forceStatusPageTheme to true to use status page theme + if (this.forceStatusPageTheme) { + return this.statusPageTheme; + } // Entry no need dark if (this.path === "") { diff --git a/src/pages/Entry.vue b/src/pages/Entry.vue index 40aeb0b2b..30e314b2f 100644 --- a/src/pages/Entry.vue +++ b/src/pages/Entry.vue @@ -26,6 +26,7 @@ export default { if (res.type === "statusPageMatchedDomain") { this.statusPageSlug = res.statusPageSlug; + this.$root.forceStatusPageTheme = true; } else if (res.type === "entryPage") { // Dev only. For production, the logic is in the server side const entryPage = res.entryPage;