Skip to content

Commit

Permalink
refactor: use isCRX fn in if/else
Browse files Browse the repository at this point in the history
  • Loading branch information
cdrani committed Oct 2, 2024
1 parent db4d599 commit 33a1896
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions packages/common/components/License.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,7 @@
const url = await response.json()
if (!url) return
if (typeof chrome !== 'undefined' && chrome.runtime) {
chrome.tabs.create({ url })
} else {
window.location.assign(url)
}
isCRX() ? chrome.tabs.create({ url }) : window.location.assign(url)
} catch (error) {
console.error('Error in handleUpgrade: ', error)
}
Expand Down

0 comments on commit 33a1896

Please sign in to comment.