File tree Expand file tree Collapse file tree 4 files changed +11
-3
lines changed Expand file tree Collapse file tree 4 files changed +11
-3
lines changed Original file line number Diff line number Diff line change 11module . exports = {
22 transformIgnorePatterns : [ '[/\\\\]node_modules[/\\\\](?!(axios|is-retry-allowed)).+\\.(js|jsx)$' ] ,
33 setupFilesAfterEnv : [ '<rootDir>/test/crypto.ts' ] ,
4+ setupFiles : [ '<rootDir>/setup.jest.js' ] ,
45} ;
Original file line number Diff line number Diff line change 1+ import { TextDecoder , TextEncoder } from 'util' ;
2+ global . TextEncoder = TextEncoder ;
3+ global . TextDecoder = TextDecoder ;
Original file line number Diff line number Diff line change @@ -63,17 +63,21 @@ export const WebViewApi = () => {
6363 } ,
6464
6565 getAssets : async ( assets : string [ ] , cb : ( assets : WebviewAsset [ ] ) => void ) => {
66+ const cbf = ( str : string ) => {
67+ const assets = JSON . parse ( str ) as WebviewAsset [ ] ;
68+ cb ( assets ) ;
69+ } ;
6670 switch ( getMixinContext ( ) . platform ) {
6771 case 'iOS' :
6872 if ( window . webkit && window . webkit . messageHandlers && window . webkit . messageHandlers . getAssets ) {
69- window . assetsCallbackFunction = cb ;
73+ window . assetsCallbackFunction = cbf ;
7074 await window . webkit . messageHandlers . getAssets . postMessage ( [ assets , 'assetsCallbackFunction' ] ) ;
7175 }
7276 break ;
7377 case 'Android' :
7478 case 'Desktop' :
7579 if ( window . MixinContext && typeof window . MixinContext . getAssets === 'function' ) {
76- window . assetsCallbackFunction = cb ;
80+ window . assetsCallbackFunction = cbf ;
7781 await window . MixinContext . getAssets ( assets , 'assetsCallbackFunction' ) ;
7882 }
7983 break ;
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ declare global {
4949 getTipAddress ?: Messengers [ 'getTipAddress' ] ;
5050 tipSign ?: Messengers [ 'tipSign' ] ;
5151 } ;
52- assetsCallbackFunction ?: ( res : WebviewAsset [ ] ) => void ;
52+ assetsCallbackFunction ?: ( res : string ) => void ;
5353 tipAddressCallbackFunction ?: ( address : string ) => void ;
5454 tipSignCallbackFunction ?: ( signature : string ) => void ;
5555 }
You can’t perform that action at this time.
0 commit comments