| @@ -65,7 +65,7 @@ export default () => { | |||||
| }, [loaderRef, loading]) | }, [loaderRef, loading]) | ||||
| useLayoutEffect (() => { | useLayoutEffect (() => { | ||||
| const savedState = sessionStorage.getItem ('posts') | |||||
| const savedState = sessionStorage.getItem (`posts:${ tagsQuery }`) | |||||
| if (savedState && navigationType === 'POP') | if (savedState && navigationType === 'POP') | ||||
| { | { | ||||
| const { posts, cursor, scroll } = JSON.parse (savedState) | const { posts, cursor, scroll } = JSON.parse (savedState) | ||||
| @@ -76,8 +76,6 @@ export default () => { | |||||
| containerRef.current.scrollTop = scroll | containerRef.current.scrollTop = scroll | ||||
| loadMore (true) | loadMore (true) | ||||
| sessionStorage.removeItem ('posts') | |||||
| } | } | ||||
| else | else | ||||
| { | { | ||||
| @@ -124,7 +122,8 @@ export default () => { | |||||
| const statesToSave = { | const statesToSave = { | ||||
| posts, cursor, | posts, cursor, | ||||
| scroll: containerRef.current?.scrollTop ?? 0 } | scroll: containerRef.current?.scrollTop ?? 0 } | ||||
| sessionStorage.setItem ('posts', JSON.stringify (statesToSave)) | |||||
| sessionStorage.setItem (`posts:${ tagsQuery }`, | |||||
| JSON.stringify (statesToSave)) | |||||
| }} />) | }} />) | ||||
| : !(loading) && '広場には何もありませんよ.'} | : !(loading) && '広場には何もありませんよ.'} | ||||
| {loading && 'Loading...'} | {loading && 'Loading...'} | ||||