File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -5,9 +5,9 @@ import {logoutFromWorker} from '../modules/worker.ts';
55const { appSubUrl, notificationSettings, assetVersionEncoded} = window . config ;
66let notificationSequenceNumber = 0 ;
77
8- async function receiveUpdateCount ( event : MessageEvent ) {
8+ async function receiveUpdateCount ( event : MessageEvent < { type : string , data : string } > ) {
99 try {
10- const data = event . data ;
10+ const data = JSON . parse ( event . data . data ) ;
1111 for ( const count of document . querySelectorAll ( '.notification_count' ) ) {
1212 count . classList . toggle ( 'tw-hidden' , data . Count === 0 ) ;
1313 count . textContent = `${ data . Count } ` ;
@@ -44,7 +44,7 @@ export function initNotificationCount() {
4444 type : 'start' ,
4545 url : `${ window . location . origin } ${ appSubUrl } /user/events` ,
4646 } ) ;
47- worker . port . addEventListener ( 'message' , ( event : MessageEvent ) => {
47+ worker . port . addEventListener ( 'message' , ( event : MessageEvent < { type : string , data : string } > ) => {
4848 if ( ! event . data || ! event . data . type ) {
4949 console . error ( 'unknown worker message event' , event ) ;
5050 return ;
You can’t perform that action at this time.
0 commit comments