mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-11-05 06:50:28 +03:00
Fix space navigation & view space timeline dev-option (#2358)
* fix inaccessible space on alias change * fix new room in space open in home * allow opening space timeline * hide event timeline feature behind dev tool * add navToActivePath to clear cache function
This commit is contained in:
parent
e6f4eeca8e
commit
91632aa193
6 changed files with 81 additions and 15 deletions
|
|
@ -9,6 +9,8 @@ import {
|
|||
|
||||
const NAV_TO_ACTIVE_PATH = 'navToActivePath';
|
||||
|
||||
const getStoreKey = (userId: string): string => `${NAV_TO_ACTIVE_PATH}${userId}`;
|
||||
|
||||
type NavToActivePath = Map<string, Path>;
|
||||
|
||||
type NavToActivePathAction =
|
||||
|
|
@ -25,7 +27,7 @@ type NavToActivePathAction =
|
|||
export type NavToActivePathAtom = WritableAtom<NavToActivePath, [NavToActivePathAction], undefined>;
|
||||
|
||||
export const makeNavToActivePathAtom = (userId: string): NavToActivePathAtom => {
|
||||
const storeKey = `${NAV_TO_ACTIVE_PATH}${userId}`;
|
||||
const storeKey = getStoreKey(userId);
|
||||
|
||||
const baseNavToActivePathAtom = atomWithLocalStorage<NavToActivePath>(
|
||||
storeKey,
|
||||
|
|
@ -64,3 +66,7 @@ export const makeNavToActivePathAtom = (userId: string): NavToActivePathAtom =>
|
|||
|
||||
return navToActivePathAtom;
|
||||
};
|
||||
|
||||
export const clearNavToActivePathStore = (userId: string) => {
|
||||
localStorage.removeItem(getStoreKey(userId));
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue