Compare commits

..

No commits in common. "21d61b9c8ae4b580c1872a76d9407555fe2a73ce" and "b8e153a4bedc5b9dfb25ee9c94c7db85401ace04" have entirely different histories.

2 changed files with 6 additions and 16 deletions

View File

@ -24,22 +24,14 @@ You can mention here anything that you think is relevant for this PR. Some examp
## Checklist ## Checklist
Are your changes backwards compatible? Please answer below: - [ ] Are your changes backwards compatible?
<!-- put your answer about backwards compatibility here -->
<!-- <!--
If your PR is not ready for review yet, please mark your PR as a draft. If your PR is not ready for review yet, please mark your PR as a draft.
If changes were requested, request a new review when you incorporated the feedback. If changes were requested, request a new review when you incorporated the feedback.
--> -->
Did you QA this? Could we deploy this straight to production? Please answer below: - [ ] Did you QA this? Could we deploy this straight to production?
<!-- put your answer about QA here --> - [ ] For frontend changes: Tested on mobile?
For frontend changes: Tested on mobile? Please answer below: - [ ] Did you introduce any new environment variables? If so, call them out explicitly in the PR description.
<!-- put your answer about mobile QA here -->
Did you introduce any new environment variables? If so, call them out explicitly here:
<!-- put your answer about env vars here -->

View File

@ -7,11 +7,9 @@ import { LNCProvider, useLNC } from './lnc'
const WebLNContext = createContext({}) const WebLNContext = createContext({})
const isEnabled = p => [Status.Enabled, Status.Locked].includes(p?.status)
const syncProvider = (array, provider) => { const syncProvider = (array, provider) => {
const idx = array.findIndex(({ name }) => provider.name === name) const idx = array.findIndex(({ name }) => provider.name === name)
const enabled = isEnabled(provider) const enabled = [Status.Enabled, Status.Locked].includes(provider.status)
if (idx === -1) { if (idx === -1) {
// add provider to end if enabled // add provider to end if enabled
return enabled ? [...array, provider] : array return enabled ? [...array, provider] : array
@ -115,7 +113,7 @@ function RawWebLNProvider ({ children }) {
}, [setEnabledProviders]) }, [setEnabledProviders])
return ( return (
<WebLNContext.Provider value={{ provider: isEnabled(provider) ? { sendPayment: sendPaymentWithToast } : null, enabledProviders, setProvider }}> <WebLNContext.Provider value={{ provider: provider ? { sendPayment: sendPaymentWithToast } : null, enabledProviders, setProvider }}>
{children} {children}
</WebLNContext.Provider> </WebLNContext.Provider>
) )