Cleanup and refactor AuthStore (#6086)

This commit is contained in:
Tom Moor
2023-10-28 12:43:50 -04:00
committed by GitHub
parent 3cd90f3e74
commit 1e847dc1cf
11 changed files with 136 additions and 184 deletions

View File

@@ -42,7 +42,7 @@ function Icon({ className }: { className?: string }) {
}
export default function LanguagePrompt() {
const { auth, ui } = useStores();
const { ui } = useStores();
const { t } = useTranslation();
const user = useCurrentUser();
const language = detectLanguage();
@@ -75,9 +75,7 @@ export default function LanguagePrompt() {
<Link
onClick={async () => {
ui.setLanguagePromptDismissed();
await auth.updateUser({
language,
});
await user.save({ language });
}}
>
{t("Change Language")}