diff options
author | Samuel Newman <mozzius@protonmail.com> | 2025-06-17 12:37:14 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-06-17 02:37:14 -0700 |
commit | 21989b558bd074bf84ac08c174d7a411fda1ffb7 (patch) | |
tree | f5f28510cf5a592b83bcfc581a57e992823eb402 /src/lib/routes/router.ts | |
parent | 7dc6bb57a6666db3e507630c13448487acceadc5 (diff) | |
download | voidsky-21989b558bd074bf84ac08c174d7a411fda1ffb7.tar.zst |
Granular notification settings (#8484)
* add mockup screen * add notification index screen * add redirect screen * upgrade sdk * new icons * add new screens * make router typesafe, finish adding screens * add routes to go server * load settings * push notif settings * improve web * fix lockfile lint * no $type on preferences * prompt to enable push notifications * fix reply prefs * space out options * fix copy error * Update RepostsOnRepostsNotificationSettings.tsx * only send minimal diff to putPrefs * fix yarn.lock * Update Navigation.tsx Co-authored-by: surfdude29 <149612116+surfdude29@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: surfdude29 <149612116+surfdude29@users.noreply.github.com> * Update src/screens/Settings/NotificationSettings/index.tsx Co-authored-by: surfdude29 <149612116+surfdude29@users.noreply.github.com> * add description to `syncOthers` --------- Co-authored-by: surfdude29 <149612116+surfdude29@users.noreply.github.com>
Diffstat (limited to 'src/lib/routes/router.ts')
-rw-r--r-- | src/lib/routes/router.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/routes/router.ts b/src/lib/routes/router.ts index ba76b1bda..c74192f29 100644 --- a/src/lib/routes/router.ts +++ b/src/lib/routes/router.ts @@ -1,8 +1,8 @@ import {type Route, type RouteParams} from './types' -export class Router { +export class Router<T extends Record<string, any>> { routes: [string, Route][] = [] - constructor(description: Record<string, string | string[]>) { + constructor(description: Record<keyof T, string | string[]>) { for (const [screen, pattern] of Object.entries(description)) { if (typeof pattern === 'string') { this.routes.push([screen, createRoute(pattern)]) @@ -14,7 +14,7 @@ export class Router { } } - matchName(name: string): Route | undefined { + matchName(name: keyof T | (string & {})): Route | undefined { for (const [screenName, route] of this.routes) { if (screenName === name) { return route |