Skip to content

Commit

Permalink
Misc Updates to web worker (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
mmumby authored Oct 4, 2023
1 parent 60a3784 commit cc7af8f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
19 changes: 13 additions & 6 deletions frontend/public/inactivityWorker.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,29 @@
const TWENTY_FIVE_MINUTES = 1500;
const TWO_MINUTES = 120;

let countdown = TWO_MINUTES + TWENTY_FIVE_MINUTES;
let timer = TWENTY_FIVE_MINUTES + TWO_MINUTES;
const time = TWO_MINUTES + TWENTY_FIVE_MINUTES;
let countdown = time;
let timer = time;

setInterval(() => {
timer--;
countdown--;
if (countdown > 0) {
countdown--;
}
postMessage({ type: 'TICK', timer, countdown });
}, 1000);

self.onmessage = (event) => {
if (event.data === 'RESET') {
timer = TWENTY_FIVE_MINUTES;
timer = time;

if (countdown < 120) {
countdown = time;
}
}

if (event.data === 'RESET_ALL') {
countdown = TWO_MINUTES + TWENTY_FIVE_MINUTES;
timer = TWO_MINUTES + TWENTY_FIVE_MINUTES;
countdown = time;
timer = time;
}
};
2 changes: 1 addition & 1 deletion frontend/src/components/common/DocumentUpload.vue
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export default {
!value ||
!value.length ||
value[0].size < 32000000 ||
`File size should not be larger than ${humanFileSize(32000000)}!`;
`File size should not be larger than 32MB`;
if (ret !== true) {
this.setFailureAlert(ret);
}
Expand Down

0 comments on commit cc7af8f

Please sign in to comment.