From 02af7391e7214ec3d2a634f490627cf4b9cff774 Mon Sep 17 00:00:00 2001 From: Bauke Date: Sat, 1 Jul 2023 12:14:02 +0200 Subject: [PATCH] Add a warning to logged out users that tours will break. --- source/content-scripts/scss/main.scss | 6 ++++++ source/tours/interface/homepage.tsx | 22 ++++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/source/content-scripts/scss/main.scss b/source/content-scripts/scss/main.scss index 55c3325..2aa5408 100644 --- a/source/content-scripts/scss/main.scss +++ b/source/content-scripts/scss/main.scss @@ -20,3 +20,9 @@ width: 1rem; } } + +.tish-warning { + border: 1px solid var(--alert-color); + color: var(--alert-color); + padding: 8px; +} diff --git a/source/tours/interface/homepage.tsx b/source/tours/interface/homepage.tsx index 6880106..257c7fb 100644 --- a/source/tours/interface/homepage.tsx +++ b/source/tours/interface/homepage.tsx @@ -6,8 +6,30 @@ import { renderInContainer, } from "../utilities.js"; +const userIsLoggedIn = + document.querySelector(".logged-in-user-username") !== null; + const step01 = renderInContainer( <> + {userIsLoggedIn ? ( + "" + ) : ( +

+ It looks like you aren't logged in to Tildes. Tildes Shepherd assumes + that you are logged in as a lot of the Tildes interface isn't shown to + logged out users. +
+ To still let anyone without an account benefit from the extension you + may continue, however, know that certain parts of the tour + will + {" "} + break and look weird. +
+ It's highly recommended that you exit the tour, log in and start it + again. +

+ )} +

The Homepage