Update app.js
#1
by Pepguy - opened
app.js
CHANGED
|
@@ -45,7 +45,28 @@ const PM_PHASES = [
|
|
| 45 |
];
|
| 46 |
|
| 47 |
// --- HELPER FUNCTIONS ---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 49 |
function startStatusLoop(projectId, type = 'worker') {
|
| 50 |
const phases = type === 'pm' ? PM_PHASES : WORKER_PHASES;
|
| 51 |
let index = 0;
|
|
@@ -58,7 +79,7 @@ function startStatusLoop(projectId, type = 'worker') {
|
|
| 58 |
}, 2000); // Slightly faster updates for better UI feedback
|
| 59 |
|
| 60 |
return () => clearInterval(interval);
|
| 61 |
-
}
|
| 62 |
|
| 63 |
function extractWorkerPrompt(text) {
|
| 64 |
if (!text || typeof text !== 'string') return null;
|
|
|
|
| 45 |
];
|
| 46 |
|
| 47 |
// --- HELPER FUNCTIONS ---
|
| 48 |
+
function startStatusLoop(projectId, type = 'worker') {
|
| 49 |
+
const phases = type === 'pm' ? PM_PHASES : WORKER_PHASES;
|
| 50 |
+
let index = 0;
|
| 51 |
+
|
| 52 |
+
// Set the initial state immediately
|
| 53 |
+
StateManager.setStatus(projectId, phases[0]);
|
| 54 |
+
|
| 55 |
+
const interval = setInterval(() => {
|
| 56 |
+
if (index < phases.length - 1) {
|
| 57 |
+
index++;
|
| 58 |
+
StateManager.setStatus(projectId, phases[index]);
|
| 59 |
+
} else {
|
| 60 |
+
// Stop the loop once we reach the last entry
|
| 61 |
+
clearInterval(interval);
|
| 62 |
+
}
|
| 63 |
+
}, 3500); // 3.5 second delay as requested
|
| 64 |
|
| 65 |
+
// Return a cleanup function in case the component unmounts early
|
| 66 |
+
return () => clearInterval(interval);
|
| 67 |
+
};
|
| 68 |
+
|
| 69 |
+
/*
|
| 70 |
function startStatusLoop(projectId, type = 'worker') {
|
| 71 |
const phases = type === 'pm' ? PM_PHASES : WORKER_PHASES;
|
| 72 |
let index = 0;
|
|
|
|
| 79 |
}, 2000); // Slightly faster updates for better UI feedback
|
| 80 |
|
| 81 |
return () => clearInterval(interval);
|
| 82 |
+
} */
|
| 83 |
|
| 84 |
function extractWorkerPrompt(text) {
|
| 85 |
if (!text || typeof text !== 'string') return null;
|