@mandujs/core 0.9.8 → 0.9.9
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/package.json +1 -1
- package/src/client/router.ts +14 -1
package/package.json
CHANGED
package/src/client/router.ts
CHANGED
|
@@ -264,11 +264,24 @@ function handlePopState(event: PopStateEvent): void {
|
|
|
264
264
|
const state = event.state;
|
|
265
265
|
|
|
266
266
|
if (state?.routeId) {
|
|
267
|
-
//
|
|
267
|
+
// Mandu로 방문한 페이지 - 데이터 다시 fetch
|
|
268
268
|
navigate(window.location.pathname + window.location.search, {
|
|
269
269
|
replace: true,
|
|
270
270
|
scroll: false,
|
|
271
271
|
});
|
|
272
|
+
} else {
|
|
273
|
+
// 직접 URL 입력 등으로 방문한 페이지 - 상태만 업데이트
|
|
274
|
+
const route = (window as any).__MANDU_ROUTE__;
|
|
275
|
+
setGlobalRouterState({
|
|
276
|
+
currentRoute: route ? {
|
|
277
|
+
id: route.id,
|
|
278
|
+
pattern: route.pattern,
|
|
279
|
+
params: route.params || {},
|
|
280
|
+
} : null,
|
|
281
|
+
loaderData: getGlobalRouterState().loaderData,
|
|
282
|
+
navigation: { state: "idle" },
|
|
283
|
+
});
|
|
284
|
+
notifyListeners();
|
|
272
285
|
}
|
|
273
286
|
}
|
|
274
287
|
|