Skip to content

Commit

Permalink
#3 add tooltip for footer buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
motorina0 committed May 31, 2021
1 parent 1e72e82 commit cd98bc3
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 18 deletions.
46 changes: 29 additions & 17 deletions src/components/LNbitsWrapper.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
:color="'blue-grey-1'"
:size="'32px'"
class="cursor-pointer"
></q-icon>
>
<q-tooltip> Manage User </q-tooltip>
</q-icon>
<q-space />
<q-icon
name="fullscreen"
Expand All @@ -24,7 +26,9 @@
:color="'blue-grey-1'"
:size="'32px'"
class="cursor-pointer"
></q-icon>
>
<q-tooltip> Full Screen </q-tooltip>
</q-icon>
<q-space />
<q-icon
name="open_in_new"
Expand All @@ -33,7 +37,9 @@
:color="'blue-grey-1'"
:size="'32px'"
class="cursor-pointer"
></q-icon>
>
<q-tooltip> {{ serverUrl }} </q-tooltip>
</q-icon>
</q-toolbar>
</q-footer>
</q-layout>
Expand All @@ -44,25 +50,40 @@
import browser from 'webextension-polyfill'
export default {
name: 'lnbits-wrapper',
data() {
return {
user: {},
serverUrl: '',
}
},
async mounted() {
const serverResult = await browser.storage.sync.get({
serverUrl: '',
})
this.serverUrl = serverResult.serverUrl
const result = await browser.storage.sync.get({
user: '',
})
this.user = result.user
const userId = this.$route.query.userId || ''
const walletId = this.$route.query.walletId || ''
const result = await this.$browser.storage.sync.get({ serverUrl: '' })
const serverUrl = result.serverUrl
// TODO: no user/wallet/serverUrl found
const closeLoading = this.$q.notify({
type: 'ongoing',
message: 'Loading...',
caption: serverUrl,
caption: this.serverUrl,
position: 'center',
timeout: 1500,
spinner: true,
})
const iFrame = document.getElementById('lnbits-site')
iFrame.src = `${serverUrl}/wallet?usr=${userId}&wal=${walletId}`
iFrame.src = `${this.serverUrl}/wallet?usr=${userId}&wal=${walletId}`
iFrame.addEventListener('load', function () {
closeLoading()
})
Expand All @@ -76,16 +97,7 @@ export default {
},
async gotoWebSite() {
try {
const serverResult = await browser.storage.sync.get({
serverUrl: '',
})
const serverUrl = serverResult.serverUrl
const result = await browser.storage.sync.get({
user: '',
})
const user = result.user
const url = `${serverUrl}/wallet?usr=${user.id}`
const url = `${this.serverUrl}/wallet?usr=${this.user.id}`
browser.tabs.create({ url })
} catch (err) {
console.error(err)
Expand Down
1 change: 0 additions & 1 deletion src/views/popup/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ async function init() {
const user = result.user

if (serverUrl && user && user.id && user.wallets && user.wallets.length) {

router.replace({
path: 'lnbits',
query: {
Expand Down

0 comments on commit cd98bc3

Please sign in to comment.