|
76 | 76 | let activeConfig = config ? config : defaultConfig; |
77 | 77 | let mainColor = activeConfig.colors.main; |
78 | 78 | let secondaryColor = activeConfig.colors.secondary; |
79 | | - let account: GetAccountReturnType | undefined = wagmiConfig && getAccount(wagmiConfig); |
| 79 | + let account: GetAccountReturnType | undefined = |
| 80 | + wagmiConfig && getAccount(wagmiConfig); |
80 | 81 |
|
81 | 82 | let loading = false; |
82 | 83 | let searchQuery = ""; |
|
142 | 143 | if (typeof unwatchAccount === "function") unwatchAccount(); |
143 | 144 | }); |
144 | 145 |
|
145 | | - $: cipherProvider = |
146 | | - requestNetwork?.getCipherProvider() as CipherProvider; |
| 146 | + $: cipherProvider = requestNetwork?.getCipherProvider() as CipherProvider; |
147 | 147 |
|
148 | 148 | $: { |
149 | 149 | signer = account?.address; |
|
155 | 155 | currencyManager = initializeCurrencyManager(currencies); |
156 | 156 | }); |
157 | 157 |
|
158 | | - const getRequests = async (account: GetAccountReturnType, requestNetwork: RequestNetwork | undefined | null) => { |
| 158 | + const getRequests = async ( |
| 159 | + account: GetAccountReturnType, |
| 160 | + requestNetwork: RequestNetwork | undefined | null |
| 161 | + ) => { |
159 | 162 | if (!account?.address || !requestNetwork) return; |
160 | 163 |
|
161 | 164 | try { |
|
385 | 388 | activeRequest = undefined; |
386 | 389 | }; |
387 | 390 |
|
388 | | - const loadRequests = async (sliderValue: string, currentAccount: GetAccountReturnType | undefined, currentRequestNetwork: RequestNetwork | undefined | null) => { |
389 | | - if (!currentAccount?.address || !currentRequestNetwork || !cipherProvider) return; |
| 391 | + const loadRequests = async ( |
| 392 | + sliderValue: string, |
| 393 | + currentAccount: GetAccountReturnType | undefined, |
| 394 | + currentRequestNetwork: RequestNetwork | undefined | null |
| 395 | + ) => { |
| 396 | + if (!currentAccount?.address || !currentRequestNetwork || !cipherProvider) |
| 397 | + return; |
390 | 398 |
|
391 | 399 | loading = true; |
392 | 400 | if (sliderValue === "on") { |
393 | 401 | try { |
394 | 402 | const signer = await getEthersSigner(wagmiConfig); |
395 | 403 | if (signer && currentAccount?.address) { |
396 | | - loadSessionSignatures = localStorage?.getItem("lit-wallet-sig") === null; |
397 | | - await cipherProvider?.getSessionSignatures(signer, currentAccount.address, window.location.host, "Sign in to Lit Protocol through Request Network"); |
| 404 | + loadSessionSignatures = |
| 405 | + localStorage?.getItem("lit-wallet-sig") === null; |
| 406 | + await cipherProvider?.getSessionSignatures( |
| 407 | + signer, |
| 408 | + currentAccount.address, |
| 409 | + window.location.host, |
| 410 | + "Sign in to Lit Protocol through Request Network" |
| 411 | + ); |
398 | 412 | cipherProvider?.enableDecryption(true); |
399 | 413 | localStorage?.setItem("isDecryptionEnabled", JSON.stringify(true)); |
400 | 414 | } |
|
413 | 427 | await getRequests(currentAccount, currentRequestNetwork); |
414 | 428 | loading = false; |
415 | 429 | }; |
| 430 | +
|
416 | 431 | $: loadRequests(sliderValueForDecryption, account, requestNetwork); |
417 | 432 | </script> |
418 | 433 |
|
|
421 | 436 | style="--mainColor: {mainColor}; --secondaryColor: {secondaryColor}; " |
422 | 437 | > |
423 | 438 | {#if loadSessionSignatures} |
424 | | - <Modal |
425 | | - config={config} |
426 | | - isOpen={true} |
427 | | - title="Lit Protocol Signature Required" |
428 | | - > |
| 439 | + <Modal {config} isOpen={true} title="Lit Protocol Signature Required"> |
429 | 440 | <div class="modal-content"> |
430 | | - <p>This signature is required only once per session and will allow you to:</p> |
| 441 | + <p> |
| 442 | + This signature is required only once per session and will allow you |
| 443 | + to: |
| 444 | + </p> |
431 | 445 | <ul> |
432 | 446 | <li>Access encrypted invoice details</li> |
433 | 447 | </ul> |
|
708 | 722 | <td><StatusLabel status={checkStatus(request)} /></td> |
709 | 723 | <td> |
710 | 724 | {#if request.paymentCurrencies.length > 0} |
711 | | - <Network network={request.paymentCurrencies[0]?.network} /> |
| 725 | + <Network |
| 726 | + network={request.paymentCurrencies[0]?.network} |
| 727 | + showLabel={true} |
| 728 | + /> |
712 | 729 | {:else} |
713 | 730 | <span class="text-gray-400">-</span> |
714 | 731 | {/if} |
|
1068 | 1085 |
|
1069 | 1086 | .modal-content li { |
1070 | 1087 | margin-bottom: 0.5rem; |
1071 | | - color: #4B5563; |
| 1088 | + color: #4b5563; |
1072 | 1089 | } |
1073 | 1090 | </style> |
0 commit comments