refactor(frontend): every stored key declares its kind, and preferences follow the account
storage.ts's registry gives each key a kind (pref, device, view, cache, public); a key without one does not compile. A contract test refuses a key spelled out elsewhere, an account preference read or written straight from storage instead of through usePref, and an e2e seed of a key nobody reads. The keys the next account's wipe keeps are the public ones. The seven preferences kept only in the browser move onto usePref: start on Home, the onboarding dismissal, the release banner's last version, the channel manager's layout, the Plex playlist layout, the playlist rail's sort and channel discovery's sort. usePref reads an older bare-string copy, and a value only this browser held is saved to the server once, so the account's other devices get it. Performance mode is the device's: it is neither read from the account nor saved to it.
This commit is contained in:
@@ -65,7 +65,14 @@ function Dots({ index, total }: { index: number; total: number }) {
|
||||
);
|
||||
}
|
||||
|
||||
export default function OnboardingWizard({ me, onClose }: { me: Me; onClose: () => void }) {
|
||||
export default function OnboardingWizard({
|
||||
me,
|
||||
onClose,
|
||||
}: {
|
||||
me: Me;
|
||||
/** `dismiss`: the essential read step was skipped, so the wizard stops opening by itself. */
|
||||
onClose: (dismiss: boolean) => void;
|
||||
}) {
|
||||
const { t } = useTranslation();
|
||||
const qc = useQueryClient();
|
||||
const importTriggered = useRef(false);
|
||||
@@ -110,8 +117,8 @@ export default function OnboardingWizard({ me, onClose }: { me: Me; onClose: ()
|
||||
// Closing without finishing the essential read step suppresses future auto-popups
|
||||
// (it stays reachable from Settings). Once read is granted, closing is just "done".
|
||||
const close = () => {
|
||||
endOnboarding(!me.can_read);
|
||||
onClose();
|
||||
endOnboarding();
|
||||
onClose(!me.can_read);
|
||||
};
|
||||
const overlayOrder = useOverlayOrder(); // this overlay's toast-host rank (see ui/Toaster)
|
||||
|
||||
@@ -274,8 +281,8 @@ export default function OnboardingWizard({ me, onClose }: { me: Me; onClose: ()
|
||||
variant="ghost"
|
||||
size="md"
|
||||
onClick={() => {
|
||||
endOnboarding(false);
|
||||
onClose();
|
||||
endOnboarding();
|
||||
onClose(false);
|
||||
}}
|
||||
>
|
||||
{t("onboarding.write.keepReadOnly")}
|
||||
@@ -299,8 +306,8 @@ export default function OnboardingWizard({ me, onClose }: { me: Me; onClose: ()
|
||||
size="lg"
|
||||
fullWidth
|
||||
onClick={() => {
|
||||
endOnboarding(false);
|
||||
onClose();
|
||||
endOnboarding();
|
||||
onClose(false);
|
||||
}}
|
||||
>
|
||||
{t("onboarding.done.done")}
|
||||
|
||||
Reference in New Issue
Block a user