Skip to content

Commit 285614a

Browse files
committed
made popup not do auth checks for speed and fixed issue with "syncing" text staying on screen too long.
1 parent dc5f97c commit 285614a

1 file changed

Lines changed: 8 additions & 10 deletions

File tree

features/popup/popup-app.tsx

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -102,20 +102,18 @@ export default function App() {
102102
});
103103
};
104104

105-
// Send message to background script to run audit (background has access to tabs/scripting APIs)
105+
// The background owns the auth checks: it refuses on a known-dead session
106+
// and the run's own form fetch is a live check, either way opening the
107+
// login page — no need for a slow probe from here first.
106108
const handleRerunAudit = async () => {
107109
setRunningAudit(true);
108-
const stillLoggedIn = await refreshLoginState();
109-
setLoggedIn(stillLoggedIn);
110-
if (!stillLoggedIn) {
110+
try {
111+
const response = await sendRuntimeMessage({ type: "RUN_NEW_AUDIT" });
112+
if (response && !response.success) setRunningAudit(false);
113+
} catch (error) {
114+
console.error("Failed to run audit:", error);
111115
setRunningAudit(false);
112-
handleLogin();
113-
return;
114116
}
115-
const response = await sendRuntimeMessage({ type: "RUN_NEW_AUDIT" });
116-
// Background refuses when the session is dead (it opens the login page
117-
// instead) — don't leave the spinner running.
118-
if (response && !response.success) setRunningAudit(false);
119117
};
120118

121119
const handleLogin = () => {

0 commit comments

Comments
 (0)