v0.12.45 fixed Guardian only feature
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "rosterchirp-frontend",
|
||||
"version": "0.12.44",
|
||||
"version": "0.12.45",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
||||
@@ -64,13 +64,13 @@ export default function ProfileModal({ onClose }) {
|
||||
|
||||
// Load login type + check if user is in guardians group
|
||||
useEffect(() => {
|
||||
Promise.all([api.getSettings(), api.getMyUserGroups()]).then(([{ settings: s }, { groups }]) => {
|
||||
Promise.all([api.getSettings(), api.getMyUserGroups()]).then(([{ settings: s }, { userGroups }]) => {
|
||||
const lt = s.feature_login_type || 'all_ages';
|
||||
const gid = parseInt(s.feature_guardians_group_id);
|
||||
setLoginType(lt);
|
||||
setGuardiansGroupId(gid || null);
|
||||
if (lt !== 'all_ages' && gid) {
|
||||
const inGroup = (groups || []).some(g => g.id === gid);
|
||||
const inGroup = (userGroups || []).some(g => g.id === gid);
|
||||
setShowAddChild(inGroup);
|
||||
}
|
||||
}).catch(() => {});
|
||||
|
||||
Reference in New Issue
Block a user