# extendify/3.2.2/src/Agent/lib/reload.js

Extendify, version 3.2.2. 14 lines.

- Page: https://pluginprobe.com/plugins/extendify/3.2.2/code/src/Agent/lib/reload.js
- Raw: https://pluginprobe.com/plugins/extendify/3.2.2/raw/src/Agent/lib/reload.js
- Modified: 2026-10-01T15:30:38+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/extendify/3.2.2/code/src/Agent/lib/reload.js#L10-L20`.

```javascript
import { flushChatStorage } from '@agent/state/chat';
import { useStatusStore } from '@agent/state/status';

// Components navigate through this so the pending chat save always lands first.
export const doReload = async (url) => {
	const flush = flushChatStorage();
	// Set before the success message paints; the reloaded page opens on this rail.
	document.documentElement.classList.add('extendify-agent-reloading');
	useStatusStore.getState().setLeavingPage(true);
	await flush;
	if (url) return window.location.assign(url);
	window.location.reload();
};

```
