Skip to content

Commit

Permalink
chore(app): apply code fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
rhahao committed Jan 13, 2025
1 parent 5e0a878 commit 3152fee
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ const LivingPart = ({ week, timings }: LivingPartProps) => {
)}
<SongSource meeting="midweek" week={week} type="middle" />
</PrimaryFieldContainer>
<SecondaryFieldContainer laptopUp={laptopUp} />
<SecondaryFieldContainer
sx={{ maxWidth: laptopUp ? '360px' : '100%' }}
/>
</DoubleFieldContainer>

{parts.map((part) => (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,11 @@ const useExportS88 = () => {
let value = acc;

if (current?.present) {
value += value + current.present;
value += current.present;
}

if (current?.online) {
value += value + current.online;
value += current.online;
}

return value;
Expand All @@ -159,11 +159,11 @@ const useExportS88 = () => {
let value = acc;

if (current?.present) {
value += value + current.present;
value += current.present;
}

if (current?.online) {
value += value + current.online;
value += current.online;
}

return value;
Expand Down
7 changes: 5 additions & 2 deletions src/services/worker/backupAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,11 @@ const runBackup = async () => {
});
}

if (data.message !== 'UNAUTHORIZED_REQUEST') {
if (data?.message === 'BACKUP_SENT') backup = 'completed';
if (data.message === 'error_api_internal-error') {
backup = 'failed';
self.postMessage({
error: 'BACKUP_FAILED',
});
}

if (backup !== 'completed') {
Expand Down
2 changes: 1 addition & 1 deletion src/services/worker/backupUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ export const dbGetMetadata = async () => {
const settings = await dbGetSettings();
const userRole = settings.user_settings.cong_role;
const isSecretary = userRole.includes('secretary');
const isCoordinator = userRole.includes('secretary');
const isCoordinator = userRole.includes('coordinator');
const isAdmin = userRole.includes('admin') || isSecretary || isCoordinator;
const isPublisher = isAdmin || userRole.includes('publisher');
const isElder = isAdmin || userRole.includes('elder');
Expand Down

0 comments on commit 3152fee

Please sign in to comment.