diff --git a/src/popup/components/AppSettings.vue b/src/popup/components/AppSettings.vue index a12c006..22e1544 100644 --- a/src/popup/components/AppSettings.vue +++ b/src/popup/components/AppSettings.vue @@ -207,15 +207,18 @@ export default { }, async upgrade() { if (process.env.MAC) { - console.log("send upgrade event to host app"); - await browser.runtime.sendNativeMessage( - "application.id", - JSON.stringify({ - upgrade: {}, - }) - ); + try { + console.log("send upgrade event to host app"); + await browser.runtime.sendNativeMessage( + "application.id", + JSON.stringify({ + upgrade: {}, + }) + ); + } catch (error) { + console.info("can't send data to native app", error); + } } else { - console.info("can't send data to native app", error); let apiUrl = await SLStorage.get(SLStorage.SETTINGS.API_URL); let upgradeURL = apiUrl + "/dashboard/pricing"; browser.tabs.create({ url: upgradeURL }); diff --git a/src/popup/components/Main.vue b/src/popup/components/Main.vue index 3757036..942a0e9 100644 --- a/src/popup/components/Main.vue +++ b/src/popup/components/Main.vue @@ -525,15 +525,18 @@ export default { async upgrade() { if (process.env.MAC) { - console.log("send upgrade event to host app"); - await browser.runtime.sendNativeMessage( - "application.id", - JSON.stringify({ - upgrade: {}, - }) - ); + try { + console.log("send upgrade event to host app"); + await browser.runtime.sendNativeMessage( + "application.id", + JSON.stringify({ + upgrade: {}, + }) + ); + } catch (error) { + console.info("can't send data to native app", error); + } } else { - console.info("can't send data to native app", error); let upgradeURL = this.apiUrl + "/dashboard/pricing"; browser.tabs.create({ url: upgradeURL }); }