Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ node_modules
.mypy_cache
.venv
.DS_Store
data/
4 changes: 2 additions & 2 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"role": "Lead dev"
}
],
"version": "1.1.0",
"min_lnbits_version": "1.5.0",
"version": "1.1.1",
"min_lnbits_version": "1.5.4",
"license": "MIT"
}
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "decoder",
"version": "1.0.5",
"version": "1.1.1",
"description": "",
"main": "index.js",
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "decoder"
version = "1.1.0"
version = "1.1.1"
requires-python = ">=3.10,<3.13"
description = "Decode lnurls."
authors = [{name = "Bitkarrot", email = "info@bitkarrot.co"}]
Expand All @@ -19,7 +19,7 @@ dev = [

[tool.poetry]
name = "lnbits-decoder"
version = "1.1.0"
version = "1.1.1"
description = "LNbits decoder extension"
authors = ["Bitkarrot <lnbits@bitkarrot.co>"]
package-mode = false
Expand Down
33 changes: 30 additions & 3 deletions static/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,13 @@ window.PageDecoder = {
lnurlData: '',
lnaddress: '',
lnaddressData: '',
invoiceData: ''
invoiceData: '',
version: ''
}
},
mounted() {
this.getVersion()
},
methods: {
blankallFields() {
this.invoice = ''
Expand All @@ -22,7 +26,11 @@ window.PageDecoder = {
this.lnaddressData = ''
},
sendFormData() {
let url = this.isValidLNaddress(this.input)
let input = this.input
if (input.toLowerCase().startsWith('lightning:')) {
input = input.slice(10)
}
let url = this.isValidLNaddress(input)
if (url != 'invalid') {
this.lnaddress = this.input
this.invoice = ''
Expand All @@ -32,7 +40,7 @@ window.PageDecoder = {
this.decoderData = ''
this.getLNAddressData(url)
} else {
this.decoderFunction({data: this.input})
this.decoderFunction({data: input})
}
},
isValidLNaddress(address) {
Expand Down Expand Up @@ -110,11 +118,30 @@ window.PageDecoder = {
}
})
.catch(error => {
if (error.response && error.response.data) {
if (typeof error.response.data === 'string') {
error.response.data = { detail: error.response.data }
} else if (error.response.data.message && !error.response.data.detail) {
error.response.data = { detail: error.response.data.message }
}
}
LNbits.utils.notifyApiError(error)
})
},
isObject(val) {
return val !== null && typeof val === 'object' && !Array.isArray(val)
},
async getVersion() {
try {
const response = await fetch('/decoder/api/v1/version')
if (!response.ok) {
throw new Error('Network response was not ok')
}
const data = await response.json()
this.version = data.version
} catch (error) {
console.error('Failed to fetch decoder version:', error)
}
}
}
}
2 changes: 1 addition & 1 deletion static/js/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
<q-list>
<q-card>
<q-card-section>
<p><b>Decoder Extension</b><br /></p>
<p><b>Decoder Extension v{{ version }}</b><br /></p>
<p>
Decoder is a simple BOLT11, LNURL, and Lightning Address
decoder for Lightning. Paste in your invoice or LNURL to
Expand Down
19 changes: 0 additions & 19 deletions templates/decoder/_decoder.html

This file was deleted.

224 changes: 0 additions & 224 deletions templates/decoder/index.html

This file was deleted.

Loading
Loading