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:
Diego Ochoa
2025-04-22 14:47:57 -05:00
committed by GitHub
parent 6c422011ac
commit 3430f715ec
5 changed files with 52 additions and 4 deletions

View File

@ -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);
}
}
);