about summary refs log tree commit diff
path: root/src/state/models/ui/shell.ts
diff options
context:
space:
mode:
authorPaul Frazee <pfrazee@gmail.com>2023-10-02 14:47:39 -0700
committerGitHub <noreply@github.com>2023-10-02 14:47:39 -0700
commitfd5bbb27699942f7d741d074eafdf16bfc9ecdd6 (patch)
treea7e7e6f1e7b07fc45a4988504e2509db97689079 /src/state/models/ui/shell.ts
parent2f157c152a59dc8bda3d4409204d850c2ac256a1 (diff)
downloadvoidsky-fd5bbb27699942f7d741d074eafdf16bfc9ecdd6.tar.zst
Warn the user on links that dont match their text (#1573)
* Add link warning modal when URLs do not match their text

* Simplify the misleading link case for clarity

* Fix typecheck

* fix dark mode

* Give a stronger visual indication of the root domain in the link warning

* More rigorous URL mismatch logic

* Remove debug

---------

Co-authored-by: Ansh Nanda <anshnanda10@gmail.com>
Diffstat (limited to 'src/state/models/ui/shell.ts')
-rw-r--r--src/state/models/ui/shell.ts7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/state/models/ui/shell.ts b/src/state/models/ui/shell.ts
index bd285c8cd..a8937b84c 100644
--- a/src/state/models/ui/shell.ts
+++ b/src/state/models/ui/shell.ts
@@ -154,6 +154,12 @@ export interface SwitchAccountModal {
   name: 'switch-account'
 }
 
+export interface LinkWarningModal {
+  name: 'link-warning'
+  text: string
+  href: string
+}
+
 export type Modal =
   // Account
   | AddAppPasswordModal
@@ -191,6 +197,7 @@ export type Modal =
 
   // Generic
   | ConfirmModal
+  | LinkWarningModal
 
 interface LightboxModel {}