Ongoing workout session data is persistent now
This commit is contained in:
@@ -75,8 +75,11 @@ const Profile: React.FC<ProfileProps> = ({ user, onLogout, lang, onLanguageChang
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [user.id, user.role, JSON.stringify(user.profile)]);
|
||||
|
||||
const refreshUserList = () => {
|
||||
setAllUsers(getUsers());
|
||||
const refreshUserList = async () => {
|
||||
const res = await getUsers();
|
||||
if (res.success && res.users) {
|
||||
setAllUsers(res.users);
|
||||
}
|
||||
};
|
||||
|
||||
const refreshExercises = async () => {
|
||||
@@ -143,16 +146,16 @@ const Profile: React.FC<ProfileProps> = ({ user, onLogout, lang, onLanguageChang
|
||||
}
|
||||
};
|
||||
|
||||
const handleAdminDeleteUser = (uid: string) => {
|
||||
const handleAdminDeleteUser = async (uid: string) => {
|
||||
if (confirm(t('delete_confirm', lang))) {
|
||||
deleteUser(uid);
|
||||
refreshUserList();
|
||||
await deleteUser(uid);
|
||||
await refreshUserList();
|
||||
}
|
||||
};
|
||||
|
||||
const handleAdminBlockUser = (uid: string, isBlocked: boolean) => {
|
||||
toggleBlockUser(uid, isBlocked);
|
||||
refreshUserList();
|
||||
const handleAdminBlockUser = async (uid: string, isBlocked: boolean) => {
|
||||
await toggleBlockUser(uid, isBlocked);
|
||||
await refreshUserList();
|
||||
};
|
||||
|
||||
const handleAdminResetPass = (uid: string) => {
|
||||
|
||||
Reference in New Issue
Block a user