@youdie006/prodex 0.16.9 → 0.16.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chatgpt-browser.js +15 -1
- package/package.json +1 -1
package/dist/chatgpt-browser.js
CHANGED
|
@@ -1103,7 +1103,21 @@ async function selectProject(cdp, options) {
|
|
|
1103
1103
|
if (!options.project)
|
|
1104
1104
|
return;
|
|
1105
1105
|
const hrefBefore = await cdp.evaluate("location.href");
|
|
1106
|
-
|
|
1106
|
+
// Poll for the project row instead of a single check: right after a
|
|
1107
|
+
// --new-chat navigation the sidebar's Projects section has not hydrated yet
|
|
1108
|
+
// (measured live: "0 projects visible" on the first read, rows appear
|
|
1109
|
+
// moments later) - the same class of race as the model-selector button
|
|
1110
|
+
// after new-chat (0.15.7).
|
|
1111
|
+
let hit = { ok: false };
|
|
1112
|
+
const projectDeadline = Date.now() + 6_000;
|
|
1113
|
+
for (;;) {
|
|
1114
|
+
hit = await cdp.evaluate(projectItemRectExpression(options.project));
|
|
1115
|
+
if (hit.ok && hit.x !== undefined && hit.y !== undefined)
|
|
1116
|
+
break;
|
|
1117
|
+
if (Date.now() >= projectDeadline)
|
|
1118
|
+
break;
|
|
1119
|
+
await sleep(300);
|
|
1120
|
+
}
|
|
1107
1121
|
if (!hit.ok || hit.x === undefined || hit.y === undefined) {
|
|
1108
1122
|
const detail = hit.reason && hit.reason !== "project not found in sidebar" ? ` (${hit.reason})` : "";
|
|
1109
1123
|
throw new Error(`ChatGPT project not found in sidebar: ${options.project}${detail}`);
|