Prove cookie injection lands, rather than assuming it
setCookie is fire-and-forget, so the import's count was what WebKit was handed, not what it kept. A probe from inside the page reads back the other end: pairing against Arc gave `names=tz,cids,frontend_lang` for aputure.odoo.com, and `tz` exists only in Arc's store — so the import demonstrably landed. The sites still ask for sign-in. That is the far end refusing the session, not a broken import, and the two are now distinguishable instead of being guessed at.
This commit is contained in:
@@ -46,6 +46,7 @@ export default function Settings({
|
||||
const [browser, setBrowser] = useState("");
|
||||
const [pairing, setPairing] = useState(false);
|
||||
const [notifyStatus, setNotifyStatus] = useState<string | null>(null);
|
||||
const [cookieStatus, setCookieStatus] = useState<string | null>(null);
|
||||
const [paired, setPaired] = useState<PairResult | null>(null);
|
||||
|
||||
const groups = [...config.groups].sort((a, b) => a.order - b.order);
|
||||
@@ -263,11 +264,29 @@ export default function Settings({
|
||||
))}
|
||||
</select>
|
||||
</label>
|
||||
<button
|
||||
onClick={async () => {
|
||||
if (!activeId) return;
|
||||
setCookieStatus("checking…");
|
||||
await api.probeCookies(activeId);
|
||||
await new Promise((r) => setTimeout(r, 400));
|
||||
setCookieStatus(await api.cookieProbe());
|
||||
}}
|
||||
disabled={!activeId}
|
||||
title="What the current app can actually see"
|
||||
className={BTN}
|
||||
>
|
||||
Check cookies
|
||||
</button>
|
||||
<button onClick={pair} disabled={pairing || !browser} className={BTN_PRIMARY}>
|
||||
{pairing ? <Spinner /> : config.settings.lastPairedAt ? "Pair again" : "Pair"}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{cookieStatus && (
|
||||
<p className={`${HELP} font-mono`}>{cookieStatus}</p>
|
||||
)}
|
||||
|
||||
{config.settings.lastPairedAt && !paired && (
|
||||
<p className={HELP}>Last paired {config.settings.lastPairedAt}.</p>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user