File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -72,7 +72,9 @@ onMounted(async () => {
72
72
const [{ connection }] = await Promise .all ([
73
73
import (' @devprotocol/clubs-core/connection' ),
74
74
load (' //cdn.jsdelivr.net/npm/buffer@6' ),
75
- load (' //cdn.jsdelivr.net/npm/@web3auth/modal' ),
75
+ load (' //cdn.jsdelivr.net/npm/@web3auth/modal' , () =>
76
+ Boolean (window .Modal ?.Web3Auth ),
77
+ ),
76
78
])
77
79
web3auth = new window .Modal .Web3Auth ({
78
80
clientId: props .web3authClientId ,
Original file line number Diff line number Diff line change 2
2
/* eslint-disable functional/immutable-data */
3
3
/* eslint-disable functional/no-expression-statements */
4
4
5
- export const load = async ( src : string ) : Promise < true > => {
5
+ export const load = async < T extends boolean = boolean > (
6
+ src : string ,
7
+ test ?: ( ) => Promise < T > | T ,
8
+ ) : Promise < true > => {
6
9
const id = `__load_${ window . btoa ( src ) } __`
7
10
8
11
const exists = Boolean ( document . getElementById ( id ) )
12
+ const testResult = test ? await test ( ) : true
9
13
10
- console . log ( { id, exists } )
14
+ console . log ( { id, exists, testResult } )
11
15
12
- return exists
16
+ return exists || testResult
13
17
? true
14
18
: new Promise ( ( resolve ) => {
15
19
const script = document . createElement ( 'script' )
You can’t perform that action at this time.
0 commit comments