From f91cdd36e90b150d5a62636372aeb0b53b384e9f Mon Sep 17 00:00:00 2001 From: rhahao <26148770+rhahao@users.noreply.github.com> Date: Sun, 1 Dec 2024 08:04:29 +0300 Subject: [PATCH] chore(app): manage access users update --- src/states/app.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/states/app.ts b/src/states/app.ts index affdff1ed7..e062494865 100644 --- a/src/states/app.ts +++ b/src/states/app.ts @@ -542,7 +542,9 @@ export const congregationsAppAdminState = selector({ get: ({ get }) => { const users = get(congregationUsersState); - return users.filter((record) => record.profile.cong_role.includes('admin')); + return users.filter((record) => + record.profile.cong_role?.includes('admin') + ); }, }); @@ -554,8 +556,8 @@ export const congregationsBaptizedPersonsState = selector({ return users.filter( (record) => record.profile.global_role === 'vip' && - !record.profile.cong_role.includes('admin') && - !record.profile.cong_role.includes('coordinator') + !record.profile.cong_role?.includes('admin') && + !record.profile.cong_role?.includes('coordinator') ); }, });