File tree 3 files changed +6
-1
lines changed
3 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ export const Actions = {
6
6
headerUpdate : 'headerUpdate' ,
7
7
verifyBalances : 'verifyBalances' ,
8
8
configUpdate : 'configUpdate' ,
9
+ wakeUp : 'wakeUp' ,
9
10
} ;
10
11
11
12
export const configStorageName = 'config' ;
Original file line number Diff line number Diff line change @@ -42,7 +42,9 @@ let globalLightClientVerifier: LightClientVerifier;
42
42
43
43
chrome . runtime . onMessage . addListener ( ( message , sender , sendResponse ) => {
44
44
console . log ( 'Got message' , message ) ;
45
- if ( message . action === Actions . verifyBalances ) {
45
+ if ( message . action === Actions . wakeUp ) {
46
+ console . log ( 'Got wakeUp message' ) ;
47
+ } else if ( message . action === Actions . verifyBalances ) {
46
48
if ( globalLightClientVerifier ) {
47
49
globalLightClientVerifier
48
50
. verifyBalances ( message . accountsToVerify , message . ethRoundingDigits , message . tokenRoundingDigits )
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import { EtherscanTokenholdingsPageHandler } from './sites/etherscan/tokenholdin
3
3
import { EtherscanAddressPageHandler } from './sites/etherscan/address' ;
4
4
import { MetaMaskPortfolioPageHandler } from './sites/metamask/portfolio' ;
5
5
import { PageHandler } from './PageHandler' ;
6
+ import { Actions } from '../../common' ;
6
7
7
8
function intializePageHandler < T extends PageHandler > ( handler : { new ( document : Document , window : Window ) : T } ) : T {
8
9
return new handler ( globalThis . document , globalThis . window ) ;
@@ -18,6 +19,7 @@ const currentURL = window.location.href;
18
19
( async function ( ) {
19
20
for ( const pageHandler of pageHandlers ) {
20
21
if ( pageHandler . checkMatch ( currentURL ) ) {
22
+ chrome . runtime . sendMessage ( { action : Actions . wakeUp } ) ;
21
23
await pageHandler . setup ( ) ;
22
24
await waitForClientToStart ( ) ;
23
25
pageHandler . run ( ) ;
You can’t perform that action at this time.
0 commit comments