Skip to content

Commit

Permalink
fix(app): source material for other users
Browse files Browse the repository at this point in the history
  • Loading branch information
rhahao committed Dec 3, 2024
1 parent d36582e commit 1e858f1
Showing 1 changed file with 0 additions and 26 deletions.
26 changes: 0 additions & 26 deletions src/states/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -460,32 +460,6 @@ export const JWLangState = selector({
key: 'JWLang',
get: ({ get }) => {
const appLang = get(appLangState);
const settings = get(settingsState);
const sources = get(sourcesState);

const userRole = settings.user_settings.cong_role;

const isAdmin = userRole.some(
(role) =>
role === 'admin' || role === 'coordinator' || role === 'secretary'
);

const isMidweekEditor = isAdmin || userRole.includes('midweek_schedule');
const isWeekendEditor = isAdmin || userRole.includes('weekend_schedule');
const isMeetingEditor = isMidweekEditor || isWeekendEditor;

if (!isMeetingEditor) {
const source = sources.at(0);

if (source) {
const keys = Object.keys(source.midweek_meeting.weekly_bible_reading);
return keys.at(0);
}

if (!source) {
return 'E';
}
}

const currentLang = LANGUAGE_LIST.find((lang) => lang.locale === appLang);

Expand Down

0 comments on commit 1e858f1

Please sign in to comment.