Skip to content

Commit

Permalink
🐛 FIX: A bug in connector; Now query actions log output in browser co…
Browse files Browse the repository at this point in the history
…nsole
  • Loading branch information
riverrun46 committed Sep 29, 2023
1 parent 701bf09 commit 092805f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 4 additions & 0 deletions src/content-script/inject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ const callMetalet = async (params: MetaletParams) => {
const response = await browser.runtime.sendMessage(params)

if (response?.channel === 'from-metaidwallet') {
// post on console
console.log(`🚀 Reponse from Metalet on action ${response.action} 🚀`)
console.log(response?.res)

window.postMessage(response, '*')
}
} catch (e: any) {
Expand Down
4 changes: 0 additions & 4 deletions src/lib/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,6 @@ export async function getAccount(accountId: string): Promise<Account | null> {
}

export async function getCurrentAccount(): Promise<Account | null> {
if (currentAccount.value) {
return currentAccount.value
}

const currentAccountId = await getStorage(CURRENT_ACCOUNT_ID)
if (!currentAccountId) {
return null
Expand Down
4 changes: 2 additions & 2 deletions src/lib/connector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ connector.connect = async function (accountId, host) {
}

connector.isConnected = async function (accountId, host) {
const connections = await storage.get('connections', { defaultValue: {}})
const connections = await storage.get('connections', { defaultValue: {} })
const accountConnections = connections[accountId] || {}

return accountConnections[host] !== undefined
}

connector.disconnect = async function (accountId, host) {
const connections = await storage.get('connections', { defaultValue: {}})
const connections = await storage.get('connections', { defaultValue: {} })
const accountConnections = connections[accountId] || {}

delete accountConnections[host]
Expand Down

0 comments on commit 092805f

Please sign in to comment.