Skip to content

Commit

Permalink
fix: mobile now act as desktop now
Browse files Browse the repository at this point in the history
  • Loading branch information
Jack-Works committed Jul 10, 2019
1 parent 1c08c8c commit 06854a2
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions src/extension/background-script/WelcomeService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,17 +104,5 @@ export async function backupMyKeyPair(identifier: PersonIdentifier) {
export async function openWelcomePage(id: PersonIdentifier, isMobile: boolean) {
if (!regularUsername(id.userId)) throw new TypeError(geti18nString('service_username_invalid'))
const url = browser.runtime.getURL('index.html#/welcome?identifier=' + id.toText())
if (isMobile) {
const [current] = await browser.tabs.query({ active: true })
if (current)
// ? need implement in polyfill
// return browser.tabs.update(current.id, {
// url,
// })
return browser.tabs.executeScript(current.id, {
code: 'location.href = ' + JSON.stringify(url),
})
} else {
return browser.tabs.create({ url })
}
return browser.tabs.create({ url })
}

0 comments on commit 06854a2

Please sign in to comment.