Skip to content

Commit c75b3b1

Browse files
authored
Merge pull request #199 from lightningnetworkstores/feature/adding-lightning-switch
Trello#138 Adding lightning accepted field
2 parents 60eae3f + d3dd08e commit c75b3b1

File tree

2 files changed

+22
-17
lines changed

2 files changed

+22
-17
lines changed

nuxt/components/AddStoreModal.vue

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,14 @@
125125
</v-flex>
126126
</v-layout>
127127

128+
<div class="d-flex justify-center my-4">
129+
<v-switch
130+
v-model="lightningAccepted"
131+
color="orange"
132+
label="Lightning accepted?"
133+
/>
134+
</div>
135+
128136
<v-layout row>
129137
<v-flex pl-3 pr-3>
130138
<span class="font-weight-bold"
@@ -205,6 +213,7 @@ export default {
205213
addAlert: { message: '', success: true },
206214
confirm_title: 'Store successfully added.',
207215
isLoading: false,
216+
lightningAccepted: false,
208217
209218
paymentRequest: '',
210219
paymentID: '',
@@ -287,14 +296,17 @@ export default {
287296
this.isLoading = true
288297
this.addAlert = { message: '', success: true }
289298
this.isPaid = false
299+
300+
const { contributor, url, name, description, uri } = this.addDialogForm
290301
this.$store
291302
.dispatch('addStore', {
292-
name: this.addDialogForm.name,
293-
description: this.addDialogForm.description,
294-
url: this.addDialogForm.url,
295-
uri: this.addDialogForm.uri,
296-
contributor: this.addDialogForm.contributor,
303+
contributor,
304+
description,
305+
lightningAccepted: this.lightningAccepted,
306+
name,
297307
recaptcha: token,
308+
uri,
309+
url,
298310
})
299311
.then(
300312
(response) => {

nuxt/store/actions.js

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -92,21 +92,14 @@ const actions = {
9292
},
9393
addStore(
9494
{ state },
95-
{
96-
name: name,
97-
description: description,
98-
url: url,
99-
uri: uri,
100-
sector: sector,
101-
digitalGoods: digitalGoods,
102-
contributor: contributor,
103-
recaptcha: recaptcha,
104-
}
95+
{ contributor, description, lightningAccepted, name, recaptcha, uri, url }
10596
) {
106-
let params = {
97+
const BTCLNMode = lightningAccepted ? ['payments'] : []
98+
99+
const params = {
107100
accepted: {
108101
BTC: { modes: ['payments'] },
109-
BTCLN: { modes: ['payments'] },
102+
BTCLN: { modes: BTCLNMode },
110103
},
111104
name: encodeURIComponent(name),
112105
description: encodeURIComponent(description),

0 commit comments

Comments
 (0)