fix: guess correct timezone when onboarding (#6430)
* fix: guess correct timezone * fix: redirect if on boarded Co-authored-by: Peer Richelsen <peeroke@gmail.com>pull/6429/head
parent
e62d8b4596
commit
6414903567
|
@ -19,7 +19,8 @@ interface IUserSettingsProps {
|
|||
const UserSettings = (props: IUserSettingsProps) => {
|
||||
const { user, nextStep } = props;
|
||||
const { t } = useLocale();
|
||||
const [selectedTimeZone, setSelectedTimeZone] = useState(user.timeZone ?? dayjs.tz.guess());
|
||||
const [selectedTimeZone, setSelectedTimeZone] = useState(dayjs.tz.guess());
|
||||
|
||||
const {
|
||||
register,
|
||||
handleSubmit,
|
||||
|
|
|
@ -178,6 +178,10 @@ export const getServerSideProps = async (context: GetServerSidePropsContext) =>
|
|||
throw new Error("User from session not found");
|
||||
}
|
||||
|
||||
if (user.completedOnboarding) {
|
||||
return { redirect: { permanent: false, destination: "/event-types" } };
|
||||
}
|
||||
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(context.locale ?? "", ["common"])),
|
||||
|
|
Loading…
Reference in New Issue