Ongoing workout session data is persistent now

This commit is contained in:
AG
2025-11-28 19:00:56 +02:00
parent 4c632e164e
commit d07431e4ff
10 changed files with 375 additions and 48 deletions

View File

@@ -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) => {