diff --git a/lnbits/core/static/js/wallet.js b/lnbits/core/static/js/wallet.js index 5be00bf..bad8eb4 100644 --- a/lnbits/core/static/js/wallet.js +++ b/lnbits/core/static/js/wallet.js @@ -347,8 +347,9 @@ new Vue({ created: function () { this.fetchPayments(); setTimeout(this.checkPendingPayments(), 1200); - - if (!this.$q.localStorage.getItem('lnbits.disclaimerShown')) { + }, + mounted: function () { + if (this.$refs.disclaimer && !this.$q.localStorage.getItem('lnbits.disclaimerShown')) { this.disclaimerDialog.show = true; this.$q.localStorage.set('lnbits.disclaimerShown', true); } diff --git a/lnbits/core/templates/core/wallet.html b/lnbits/core/templates/core/wallet.html index 7bfad81..bad6fc3 100644 --- a/lnbits/core/templates/core/wallet.html +++ b/lnbits/core/templates/core/wallet.html @@ -242,15 +242,18 @@ - - -
Warning
-

Login functionality to be released in v0.2, for now, make sure you bookmark this page for future access to your wallet!

-

This service is in BETA, and we hold no responsibility for people losing access to funds. To encourage you to run your own LNbits installation, any balance on {% raw %}{{ disclaimerDialog.location.host }}{% endraw %} will incur a charge of 1% service fee per week.

-
- Copy wallet URL - I understand -
-
-
+ {% if service_fee > 0 %} +
+ + +
Warning
+

Login functionality to be released in v0.2, for now, make sure you bookmark this page for future access to your wallet!

+

This service is in BETA, and we hold no responsibility for people losing access to funds. To encourage you to run your own LNbits installation, any balance on {% raw %}{{ disclaimerDialog.location.host }}{% endraw %} will incur a charge of {{ service_fee }}% service fee per week.

+
+ Copy wallet URL + I understand +
+
+
+ {% endif %} {% endblock %} diff --git a/lnbits/core/views/generic.py b/lnbits/core/views/generic.py index 535e875..d7da5b8 100644 --- a/lnbits/core/views/generic.py +++ b/lnbits/core/views/generic.py @@ -4,6 +4,7 @@ from os import path from lnbits.core import core_app from lnbits.decorators import check_user_exists, validate_uuids from lnbits.helpers import Status +from lnbits.settings import SERVICE_FEE from ..crud import ( create_account, @@ -48,6 +49,7 @@ def wallet(): user_id = request.args.get("usr", type=str) wallet_id = request.args.get("wal", type=str) wallet_name = request.args.get("nme", type=str) + service_fee = int(SERVICE_FEE) if int(SERVICE_FEE) == SERVICE_FEE else SERVICE_FEE # just wallet_name: create a new user, then create a new wallet for user with wallet_name # just user_id: return the first user wallet or create one if none found (with default wallet_name) @@ -71,7 +73,7 @@ def wallet(): if wallet_id not in user.wallet_ids: abort(Status.FORBIDDEN, "Not your wallet.") - return render_template("core/wallet.html", user=user, wallet=user.get_wallet(wallet_id)) + return render_template("core/wallet.html", user=user, wallet=user.get_wallet(wallet_id), service_fee=service_fee) @core_app.route("/deletewallet") diff --git a/lnbits/settings.py b/lnbits/settings.py index cf20390..2199343 100644 --- a/lnbits/settings.py +++ b/lnbits/settings.py @@ -1,8 +1,6 @@ import importlib import os -from decimal import Decimal - wallets_module = importlib.import_module("lnbits.wallets") wallet_class = getattr(wallets_module, os.getenv("LNBITS_BACKEND_WALLET_CLASS", "LntxbotWallet")) @@ -13,4 +11,4 @@ LNBITS_DATA_FOLDER = os.getenv("LNBITS_DATA_FOLDER", os.path.join(LNBITS_PATH, " WALLET = wallet_class() DEFAULT_WALLET_NAME = os.getenv("LNBITS_DEFAULT_WALLET_NAME", "LNbits wallet") FORCE_HTTPS = os.getenv("LNBITS_FORCE_HTTPS", "1") == "1" -SERVICE_FEE = Decimal(os.getenv("LNBITS_SERVICE_FEE", "0.0")) +SERVICE_FEE = float(os.getenv("LNBITS_SERVICE_FEE", "0.0"))