| 1 |
import { flushChatStorage } from '@agent/state/chat'; |
| 2 |
import { useStatusStore } from '@agent/state/status'; |
| 3 |
|
| 4 |
// Components navigate through this so the pending chat save always lands first. |
| 5 |
export const doReload = async (url) => { |
| 6 |
const flush = flushChatStorage(); |
| 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; |
| 11 |
if (url) return window.location.assign(url); |
| 12 |
window.location.reload(); |
| 13 |
}; |
| 14 |
|