Skip to content

Commit 3abe4cc

Browse files
authored
fix: Update isPrettified handling on initial page load (fixes #356). (#366)
1 parent eac74c6 commit 3abe4cc

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/components/AppController.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import React, {
66
import useLogFileStore from "../stores/logFileStore";
77
import useQueryStore from "../stores/queryStore";
88
import useViewStore from "../stores/viewStore";
9+
import {HASH_PARAM_NAMES} from "../typings/url";
910
import {
1011
CURSOR_CODE,
1112
CursorType,
@@ -62,7 +63,7 @@ const AppController = ({children}: AppControllerProps) => {
6263
// Handle initial page load and maintain full URL state
6364
const hashParams = getWindowUrlHashParams();
6465
updateWindowUrlHashParams({
65-
isPrettified: URL_HASH_PARAMS_DEFAULT.isPrettified,
66+
isPrettified: hashParams[HASH_PARAM_NAMES.IS_PRETTIFIED],
6667
timestamp: URL_HASH_PARAMS_DEFAULT.timestamp,
6768
});
6869
const {setIsPrettified} = useViewStore.getState();

src/stores/logFileStore.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,9 @@ const useLogFileStore = create<LogFileState>((set) => ({
158158

159159
set(fileInfo);
160160

161+
const {isPrettified} = useViewStore.getState();
162+
await logFileManagerProxy.setIsPrettified(isPrettified);
163+
161164
const pageData = await logFileManagerProxy.loadPage(cursor);
162165
updatePageData(pageData);
163166
setUiState(UI_STATE.READY);

0 commit comments

Comments
 (0)