PluginProbe
Extendify / 3.2.2
Extendify v3.2.2
3.2.2 3.2.1 3.2.0 3.1.6 3.1.5 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 3.0.6 3.0.5 3.0.4 trunk 0.1.0 0.10.0 0.10.1 0.10.2 0.11.0 0.11.1 0.2.0 0.3.0 0.3.1 0.4.0 0.5.0 All 128 releases
← All changes | src/Agent/lib/reload.js +4 -11 3.2.0 → 3.2.2 View file →
@@ -1,20 +1,13 @@
1 1 import { flushChatStorage } from '@agent/state/chat';
2 2 import { useStatusStore } from '@agent/state/status';
3 3
4 -const wait = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
5 -
6 4 // Components navigate through this so the pending chat save always lands first.
7 5 export const doReload = async (url) => {
8 6 const flush = flushChatStorage();
9 - // Quick saves skip the overlay; once shown it holds 1s so it never flashes.
10 - const saveIsSlow = await Promise.race([
11 - flush.then(() => false),
12 - wait(2000).then(() => true),
13 - ]);
14 - if (saveIsSlow) {
15 - useStatusStore.getState().setLeavingPage(true);
16 - await Promise.all([flush, wait(1000)]);
17 - }
7 + // Set before the success message paints; the reloaded page opens on this rail.
8 + document.documentElement.classList.add('extendify-agent-reloading');
9 + useStatusStore.getState().setLeavingPage(true);
10 + await flush;
18 11 if (url) return window.location.assign(url);
19 12 window.location.reload();
20 13 };