feat: add member list in setting

This commit is contained in:
Steven
2023-07-09 00:45:26 +08:00
parent c00f7d0852
commit 5db3506cba
26 changed files with 614 additions and 238 deletions

View File

@ -3,12 +3,13 @@ import React, { useEffect, useState } from "react";
import { Link, useNavigate } from "react-router-dom";
import { toast } from "react-hot-toast";
import * as api from "../helpers/api";
import { userService } from "../services";
import { useAppSelector } from "../stores";
import useLoading from "../hooks/useLoading";
import useUserStore from "../stores/v1/user";
const SignIn: React.FC = () => {
const navigate = useNavigate();
const userStore = useUserStore();
const {
workspaceProfile: { disallowSignUp },
} = useAppSelector((state) => state.global);
@ -18,7 +19,7 @@ const SignIn: React.FC = () => {
const allowConfirm = email.length > 0 && password.length > 0;
useEffect(() => {
userService.doSignOut();
api.signout();
}, []);
const handleEmailInputChanged = (e: React.ChangeEvent<HTMLInputElement>) => {
@ -39,7 +40,7 @@ const SignIn: React.FC = () => {
try {
actionBtnLoadingState.setLoading();
await api.signin(email, password);
const user = await userService.doSignIn();
const user = await userStore.fetchCurrentUser();
if (user) {
navigate("/", {
replace: true,