diff --git a/lnbits/static/components/lnbits-error.vue b/lnbits/static/components/lnbits-error.vue index 25a1b8f1f..e931b1fcb 100644 --- a/lnbits/static/components/lnbits-error.vue +++ b/lnbits/static/components/lnbits-error.vue @@ -24,7 +24,7 @@ diff --git a/lnbits/static/js/components/lnbits-error.js b/lnbits/static/js/components/lnbits-error.js deleted file mode 100644 index 7288280f2..000000000 --- a/lnbits/static/js/components/lnbits-error.js +++ /dev/null @@ -1,56 +0,0 @@ -const LnbitsError = { - template: '#lnbits-error', - props: ['dynamic', 'code', 'message'], - computed: { - isExtension() { - if (this.code != 403) return false - if (this.message.startsWith('Extension ')) return true - } - }, - methods: { - goBack() { - window.history.back() - }, - goHome() { - window.location = '/' - }, - goToWallet() { - if (this.dynamic) { - this.$router.push('/wallet') - return - } - window.location = '/wallet' - }, - goToExtension() { - const extension = this.message.match(/'([^']+)'/)[1] - const url = `/extensions#${extension}` - if (this.dynamic) { - this.$router.push(url) - return - } - window.location = url - }, - async logOut() { - try { - await LNbits.api.logout() - window.location = '/' - } catch (e) { - LNbits.utils.notifyApiError(e) - } - } - }, - async created() { - // check if we have error from error.html - if (!this.dynamic) { - if (this.code == 401) { - console.warn(`Unauthorized: ${this.errorMessage}`) - this.logOut() - return - } - } - } -} -// expose to window on the browser -if (typeof window !== 'undefined') window.LnbitsError = LnbitsError - -export default LnbitsError diff --git a/lnbits/templates/base.html b/lnbits/templates/base.html index b084e60f7..ebf125235 100644 --- a/lnbits/templates/base.html +++ b/lnbits/templates/base.html @@ -95,7 +95,7 @@ {% block scripts %}{% endblock %} - + {% for url in INCLUDED_COMPONENTS %} diff --git a/lnbits/templates/components.vue b/lnbits/templates/components.vue index a296a237d..b32d4c465 100644 --- a/lnbits/templates/components.vue +++ b/lnbits/templates/components.vue @@ -29,8 +29,7 @@ include('components/lnbits-wallet-api-docs.vue') %} {% include('components/lnbits-wallet-share.vue') %} {% include('components/lnbits-wallet-charts.vue') %} {% include('components/lnbits-wallet-paylinks.vue') %} {% -include('components/lnbits-wallet-extra.vue') %} {% -include('components/lnbits-error.vue') %} +include('components/lnbits-wallet-extra.vue') %}