forked from Archives/Athou_commafeed
add option to keep some entries above the selected entry when scrolling
This commit is contained in:
@@ -3,6 +3,7 @@ import { entriesSlice } from "app/entries/slice"
|
||||
import { redirectSlice } from "app/redirect/slice"
|
||||
import { serverSlice } from "app/server/slice"
|
||||
import { treeSlice } from "app/tree/slice"
|
||||
import type { ViewMode } from "app/types"
|
||||
import { userSlice } from "app/user/slice"
|
||||
import { type TypedUseSelectorHook, useDispatch, useSelector } from "react-redux"
|
||||
|
||||
@@ -14,7 +15,20 @@ export const reducers = {
|
||||
user: userSlice.reducer,
|
||||
}
|
||||
|
||||
export const store = configureStore({ reducer: reducers })
|
||||
export const store = configureStore({
|
||||
reducer: reducers,
|
||||
preloadedState: {
|
||||
user: {
|
||||
localSettings: {
|
||||
viewMode: localStorage.getItem("view-mode") as ViewMode,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
store.subscribe(() => {
|
||||
const state = store.getState()
|
||||
localStorage.setItem("view-mode", state.user.localSettings.viewMode)
|
||||
})
|
||||
|
||||
export type RootState = ReturnType<typeof store.getState>
|
||||
export type AppDispatch = typeof store.dispatch
|
||||
|
||||
Reference in New Issue
Block a user