@@ -38,14 +38,10 @@ const getCursorFromHashParams = ({isPrettified, logEventNum, timestamp}: {
3838 return null ;
3939 }
4040
41- const {
42- isPrettified : prevIsPrettified , setIsPrettified, setLogEventNum,
43- } = useViewStore . getState ( ) ;
41+ const { isPrettified : prevIsPrettified , setLogEventNum} = useViewStore . getState ( ) ;
4442 const clampedLogEventNum = clamp ( logEventNum , 1 , numEvents ) ;
4543
4644 if ( isPrettified !== prevIsPrettified ) {
47- setIsPrettified ( isPrettified ) ;
48-
4945 return {
5046 code : CURSOR_CODE . EVENT_NUM ,
5147 args : { eventNum : clampedLogEventNum } ,
@@ -84,7 +80,7 @@ const getCursorFromHashParams = ({isPrettified, logEventNum, timestamp}: {
8480const updateViewHashParams = ( ) => {
8581 const { isPrettified, logEventNum, timestamp} = getWindowUrlHashParams ( ) ;
8682 updateWindowUrlHashParams ( {
87- isPrettified : URL_HASH_PARAMS_DEFAULT . isPrettified ,
83+ isPrettified : isPrettified ,
8884 timestamp : URL_HASH_PARAMS_DEFAULT . timestamp ,
8985 } ) ;
9086
@@ -97,7 +93,12 @@ const updateViewHashParams = () => {
9793 ( async ( ) => {
9894 const { logFileManagerProxy} = useLogFileManagerProxyStore . getState ( ) ;
9995 const { updatePageData} = useViewStore . getState ( ) ;
100- const pageData = await logFileManagerProxy . loadPage ( cursor , isPrettified ) ;
96+ const { isPrettified : prevIsPrettified , setIsPrettified} = useViewStore . getState ( ) ;
97+ if ( isPrettified !== prevIsPrettified ) {
98+ setIsPrettified ( isPrettified ) ;
99+ await logFileManagerProxy . setIsPrettified ( isPrettified ) ;
100+ }
101+ const pageData = await logFileManagerProxy . loadPage ( cursor ) ;
101102 updatePageData ( pageData ) ;
102103 const { setUiState} = useUiStore . getState ( ) ;
103104 setUiState ( UI_STATE . READY ) ;
0 commit comments