mirror of
https://github.com/docmost/docmost.git
synced 2025-11-13 09:42:37 +10:00
feat: remember and restore previous route when exiting settings (#1046)
Improves user experience by allowing users to return to the previous page after visiting the Settings section. Co-authored-by: Philipinho <16838612+Philipinho@users.noreply.github.com>
This commit is contained in:
@ -0,0 +1,10 @@
|
||||
import { atom, WritableAtom } from "jotai";
|
||||
|
||||
export const settingsOriginAtom: WritableAtom<string | null, [string | null], void> = atom(
|
||||
null,
|
||||
(get, set, newValue) => {
|
||||
if (get(settingsOriginAtom) !== newValue) {
|
||||
set(settingsOriginAtom, newValue);
|
||||
}
|
||||
}
|
||||
);
|
||||
Reference in New Issue
Block a user