fix: custom theme persisting after signing out (#1780)
* fix: custom theme persistence * chore: remove console logs * fix: build error * fix: change theme from command k
This commit is contained in:
parent
5aad6c71da
commit
97c3fb40e7
17 changed files with 287 additions and 307 deletions
|
|
@ -3,6 +3,8 @@ import React, { useEffect, useState } from "react";
|
|||
import { useRouter } from "next/router";
|
||||
import Image from "next/image";
|
||||
|
||||
// next-themes
|
||||
import { useTheme } from "next-themes";
|
||||
// react-hook-form
|
||||
import { useForm } from "react-hook-form";
|
||||
// hooks
|
||||
|
|
@ -31,6 +33,8 @@ const ResetPasswordPage: NextPage = () => {
|
|||
|
||||
const { setToastAlert } = useToast();
|
||||
|
||||
const { setTheme } = useTheme();
|
||||
|
||||
const {
|
||||
register,
|
||||
handleSubmit,
|
||||
|
|
@ -76,6 +80,10 @@ const ResetPasswordPage: NextPage = () => {
|
|||
);
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
setTheme("system");
|
||||
}, [setTheme]);
|
||||
|
||||
useEffect(() => {
|
||||
if (parseInt(process.env.NEXT_PUBLIC_ENABLE_OAUTH || "0")) router.push("/");
|
||||
else setIsLoading(false);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue