Skip to content

Commit

Permalink
#3 show nicer loading for iframe
Browse files Browse the repository at this point in the history
  • Loading branch information
motorina0 committed May 31, 2021
1 parent 97b7d39 commit da18882
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
10 changes: 7 additions & 3 deletions src/components/LNbitsWrapper.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,21 @@ export default {
const serverUrl = result.serverUrl
// TODO: no user/wallet/serverUrl found
this.$q.notify({
type: 'info',
const closeLoading = this.$q.notify({
type: 'ongoing',
message: 'Loading...',
caption: serverUrl,
timeout: 1500,
position: 'center',
timeout: 5000,
spinner: true,
})
const iFrame = document.getElementById('lnbits-site')
iFrame.src = `${serverUrl}/wallet?usr=${userId}&wal=${walletId}`
iFrame.addEventListener('load', function () {
closeLoading()
})
},
methods: {
gotoConnectPage() {
Expand Down
1 change: 1 addition & 0 deletions src/components/Loading.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
</template>
<script>
export default {
name: 'loading',
beforeDestroy() {
this.$q.loading.hide()
},
Expand Down
2 changes: 1 addition & 1 deletion src/components/PayInvoice.vue
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ import lnbitsApi from '../services/lnbits-api.svc'
import uiUtils from '../utils/ui-utils'
export default {
name: 'payInvoice',
name: 'pay-invoice',
data() {
return {
// TODO: allow user to switch between wallets
Expand Down

0 comments on commit da18882

Please sign in to comment.