Added saving of token to web worker + Play with dark theme
This commit is contained in:
parent
7d893cb204
commit
12f9ad6c06
4 changed files with 47 additions and 5 deletions
16
public/js/workers/auth_worker.js
Normal file
16
public/js/workers/auth_worker.js
Normal file
|
@ -0,0 +1,16 @@
|
|||
self.onmessage = function (event) {
|
||||
console.log(event.data);
|
||||
const action = event.data.action;
|
||||
switch(action) {
|
||||
case 'save':
|
||||
token = event.data.token;
|
||||
break;
|
||||
case 'load':
|
||||
console.log(token);
|
||||
break;
|
||||
default:
|
||||
console.error('Invalid action');
|
||||
return;
|
||||
}
|
||||
self.postMessage(true);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue