diff --git a/lnbits/app.py b/lnbits/app.py index 83a9749bb..8e32e38bc 100644 --- a/lnbits/app.py +++ b/lnbits/app.py @@ -48,7 +48,9 @@ def create_app(config_object="lnbits.settings") -> FastAPI: app = FastAPI() app.mount("/static", StaticFiles(packages=[("lnbits", "static")]), name="static") app.mount( - "/core/static", StaticFiles(packages=[("lnbits.core", "static")]), name="core_static" + "/core/static", + StaticFiles(packages=[("lnbits.core", "static")]), + name="core_static", ) origins = ["*"] diff --git a/lnbits/extensions/offlineshop/__init__.py b/lnbits/extensions/offlineshop/__init__.py index 2dbaa7d0f..0b776a8ce 100644 --- a/lnbits/extensions/offlineshop/__init__.py +++ b/lnbits/extensions/offlineshop/__init__.py @@ -21,7 +21,6 @@ def offlineshop_renderer(): return template_renderer(["lnbits/extensions/offlineshop/templates"]) - from .lnurl import * # noqa from .views import * # noqa from .views_api import * # noqa diff --git a/lnbits/extensions/tpos/templates/tpos/tpos.html b/lnbits/extensions/tpos/templates/tpos/tpos.html index e11f60797..ebc6595e2 100644 --- a/lnbits/extensions/tpos/templates/tpos/tpos.html +++ b/lnbits/extensions/tpos/templates/tpos/tpos.html @@ -308,7 +308,9 @@ }, sat: function () { 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 () { if (!this.exchangeRate) return 0 @@ -423,10 +425,9 @@ '{{ tpos.tip_options | tojson }}' == 'null' ? null : JSON.parse('{{ tpos.tip_options }}') - console.log(typeof this.tip_options, this.tip_options) setInterval(function () { getRates() - }, 20000) + }, 120000) } }) diff --git a/lnbits/server.py b/lnbits/server.py index c0efb8953..4a63b3b7b 100644 --- a/lnbits/server.py +++ b/lnbits/server.py @@ -1,17 +1,18 @@ +import click import uvicorn -import click @click.command() -@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("--port", default="5000", help="Port to run LNBits on") +@click.option("--host", default="127.0.0.1", help="Host to run LNBits on") def main(port, host): """Launched with `poetry run lnbits` at root level""" uvicorn.run("lnbits.__main__:app", port=port, host=host) -if __name__ == '__main__': + +if __name__ == "__main__": main() -#def main(): +# def main(): # """Launched with `poetry run start` at root level""" # uvicorn.run("lnbits.__main__:app")