mirror of
https://github.com/revoltchat/revite.git
synced 2024-12-26 23:42:11 -05:00
Fix onboarding.
This commit is contained in:
parent
fd03c64d92
commit
f2a69daf03
3 changed files with 3 additions and 3 deletions
|
@ -17,7 +17,7 @@ export interface Props {
|
||||||
|
|
||||||
export default function Modals({ screen, openScreen }: Props) {
|
export default function Modals({ screen, openScreen }: Props) {
|
||||||
const onClose = () =>
|
const onClose = () =>
|
||||||
isModalClosing
|
isModalClosing || screen.id === "onboarding"
|
||||||
? openScreen({ id: "none" })
|
? openScreen({ id: "none" })
|
||||||
: internalEmit("Modal", "close");
|
: internalEmit("Modal", "close");
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@ export function OnboardingModal({ onClose, callback }: Props) {
|
||||||
const onSubmit: SubmitHandler<FormInputs> = ({ username }) => {
|
const onSubmit: SubmitHandler<FormInputs> = ({ username }) => {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
callback(username, true)
|
callback(username, true)
|
||||||
.then(onClose)
|
.then(() => onClose())
|
||||||
.catch((err: any) => {
|
.catch((err: any) => {
|
||||||
setError(takeError(err));
|
setError(takeError(err));
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
|
|
|
@ -116,7 +116,7 @@ function Context({ auth, children }: Props) {
|
||||||
if (onboarding) {
|
if (onboarding) {
|
||||||
openScreen({
|
openScreen({
|
||||||
id: "onboarding",
|
id: "onboarding",
|
||||||
callback: (username: string) =>
|
callback: async (username: string) =>
|
||||||
onboarding(username, true).then(login),
|
onboarding(username, true).then(login),
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue