mirror of
https://github.com/lnbits/lnbits.git
synced 2025-06-27 17:23:12 +02:00
Fix/hotfix tpos 2 (#783)
* fix older tpos without tips * bad math requesting invoice * make format
This commit is contained in:
parent
8cac577f2f
commit
41dc1b0512
@ -48,7 +48,9 @@ def create_app(config_object="lnbits.settings") -> FastAPI:
|
|||||||
app = FastAPI()
|
app = FastAPI()
|
||||||
app.mount("/static", StaticFiles(packages=[("lnbits", "static")]), name="static")
|
app.mount("/static", StaticFiles(packages=[("lnbits", "static")]), name="static")
|
||||||
app.mount(
|
app.mount(
|
||||||
"/core/static", StaticFiles(packages=[("lnbits.core", "static")]), name="core_static"
|
"/core/static",
|
||||||
|
StaticFiles(packages=[("lnbits.core", "static")]),
|
||||||
|
name="core_static",
|
||||||
)
|
)
|
||||||
|
|
||||||
origins = ["*"]
|
origins = ["*"]
|
||||||
|
@ -21,7 +21,6 @@ def offlineshop_renderer():
|
|||||||
return template_renderer(["lnbits/extensions/offlineshop/templates"])
|
return template_renderer(["lnbits/extensions/offlineshop/templates"])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
from .lnurl import * # noqa
|
from .lnurl import * # noqa
|
||||||
from .views import * # noqa
|
from .views import * # noqa
|
||||||
from .views_api import * # noqa
|
from .views_api import * # noqa
|
||||||
|
@ -308,7 +308,9 @@
|
|||||||
},
|
},
|
||||||
sat: function () {
|
sat: function () {
|
||||||
if (!this.exchangeRate) return 0
|
if (!this.exchangeRate) return 0
|
||||||
return Math.ceil((this.amount / this.exchangeRate) * 100000000)
|
return Math.ceil(
|
||||||
|
((this.amount - this.tipAmount) / this.exchangeRate) * 100000000
|
||||||
|
)
|
||||||
},
|
},
|
||||||
tipAmountSat: function () {
|
tipAmountSat: function () {
|
||||||
if (!this.exchangeRate) return 0
|
if (!this.exchangeRate) return 0
|
||||||
@ -423,10 +425,9 @@
|
|||||||
'{{ tpos.tip_options | tojson }}' == 'null'
|
'{{ tpos.tip_options | tojson }}' == 'null'
|
||||||
? null
|
? null
|
||||||
: JSON.parse('{{ tpos.tip_options }}')
|
: JSON.parse('{{ tpos.tip_options }}')
|
||||||
console.log(typeof this.tip_options, this.tip_options)
|
|
||||||
setInterval(function () {
|
setInterval(function () {
|
||||||
getRates()
|
getRates()
|
||||||
}, 20000)
|
}, 120000)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
@ -1,17 +1,18 @@
|
|||||||
|
import click
|
||||||
import uvicorn
|
import uvicorn
|
||||||
|
|
||||||
import click
|
|
||||||
|
|
||||||
@click.command()
|
@click.command()
|
||||||
@click.option('--port', default="5000", help='Port to run LNBits on')
|
@click.option("--port", default="5000", help="Port to run LNBits on")
|
||||||
@click.option('--host', default="127.0.0.1", help='Host to run LNBits on')
|
@click.option("--host", default="127.0.0.1", help="Host to run LNBits on")
|
||||||
def main(port, host):
|
def main(port, host):
|
||||||
"""Launched with `poetry run lnbits` at root level"""
|
"""Launched with `poetry run lnbits` at root level"""
|
||||||
uvicorn.run("lnbits.__main__:app", port=port, host=host)
|
uvicorn.run("lnbits.__main__:app", port=port, host=host)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
|
|
||||||
#def main():
|
# def main():
|
||||||
# """Launched with `poetry run start` at root level"""
|
# """Launched with `poetry run start` at root level"""
|
||||||
# uvicorn.run("lnbits.__main__:app")
|
# uvicorn.run("lnbits.__main__:app")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user