Compare commits
2 Commits
b8e153a4be
...
21d61b9c8a
Author | SHA1 | Date | |
---|---|---|---|
|
21d61b9c8a | ||
|
0f95eb6c36 |
16
.github/pull_request_template.md
vendored
16
.github/pull_request_template.md
vendored
@ -24,14 +24,22 @@ You can mention here anything that you think is relevant for this PR. Some examp
|
|||||||
|
|
||||||
## Checklist
|
## Checklist
|
||||||
|
|
||||||
- [ ] Are your changes backwards compatible?
|
Are your changes backwards compatible? Please answer below:
|
||||||
|
|
||||||
|
<!-- 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?
|
Did you QA this? Could we deploy this straight to production? Please answer below:
|
||||||
|
|
||||||
- [ ] For frontend changes: Tested on mobile?
|
<!-- put your answer about QA here -->
|
||||||
|
|
||||||
- [ ] Did you introduce any new environment variables? If so, call them out explicitly in the PR description.
|
For frontend changes: Tested on mobile? Please answer below:
|
||||||
|
|
||||||
|
<!-- 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 -->
|
||||||
|
@ -7,9 +7,11 @@ 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 = [Status.Enabled, Status.Locked].includes(provider.status)
|
const enabled = isEnabled(provider)
|
||||||
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
|
||||||
@ -113,7 +115,7 @@ function RawWebLNProvider ({ children }) {
|
|||||||
}, [setEnabledProviders])
|
}, [setEnabledProviders])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<WebLNContext.Provider value={{ provider: provider ? { sendPayment: sendPaymentWithToast } : null, enabledProviders, setProvider }}>
|
<WebLNContext.Provider value={{ provider: isEnabled(provider) ? { sendPayment: sendPaymentWithToast } : null, enabledProviders, setProvider }}>
|
||||||
{children}
|
{children}
|
||||||
</WebLNContext.Provider>
|
</WebLNContext.Provider>
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user