Skip to content

πŸ“¨ The ultimate agentic social media scheduling tool πŸ€–

fix(frontend): read chrome.runtime.lastError in extension messaging callbacks

Gilad Resisi709e05bc5e53
diff --git a/apps/frontend/src/components/launches/continue.integration.tsx b/apps/frontend/src/components/launches/continue.integration.tsx
index 096cb8ab1..dd9e404ac 100644
--- a/apps/frontend/src/components/launches/continue.integration.tsx
+++ b/apps/frontend/src/components/launches/continue.integration.tsx
@@ -183,7 +183,11 @@ export const ContinueIntegration: FC<{
jwt: extensionToken,
backendUrl,
},
- () => {}
+ () => {
+ if (chrome.runtime.lastError) {
+ return;
+ }
+ }
);
} catch {
// Silently ignore β€” extension may not be available
diff --git a/apps/frontend/src/components/launches/menu/menu.tsx b/apps/frontend/src/components/launches/menu/menu.tsx
index 9b1d16be5..053d27665 100644
--- a/apps/frontend/src/components/launches/menu/menu.tsx
+++ b/apps/frontend/src/components/launches/menu/menu.tsx
@@ -158,7 +158,11 @@ export const Menu: FC<{
chrome.runtime.sendMessage(
extensionId,
{ type: 'REMOVE_REFRESH_TOKEN', integrationId: id },
- () => {}
+ () => {
+ if (chrome.runtime.lastError) {
+ return;
+ }
+ }
);
} catch {
// Silently ignore