feat: auto-show new notes at top

This commit is contained in:
codytseng 2026-01-05 13:13:17 +08:00
parent 53a67d8233
commit d1b3a8c4c7
10 changed files with 32 additions and 82 deletions

View file

@ -21,9 +21,6 @@ type TUserPreferencesContext = {
quickReactionEmoji: string | TEmoji
updateQuickReactionEmoji: (emoji: string | TEmoji) => void
enableLiveFeed: boolean
updateEnableLiveFeed: (enable: boolean) => void
}
const UserPreferencesContext = createContext<TUserPreferencesContext | undefined>(undefined)
@ -48,7 +45,6 @@ export function UserPreferencesProvider({ children }: { children: React.ReactNod
)
const [quickReaction, setQuickReaction] = useState(storage.getQuickReaction())
const [quickReactionEmoji, setQuickReactionEmoji] = useState(storage.getQuickReactionEmoji())
const [enableLiveFeed, setEnableLiveFeed] = useState(storage.getEnableLiveFeed())
useEffect(() => {
if (!isSmallScreen && enableSingleColumnLayout) {
@ -83,11 +79,6 @@ export function UserPreferencesProvider({ children }: { children: React.ReactNod
storage.setQuickReactionEmoji(emoji)
}
const updateEnableLiveFeed = (enable: boolean) => {
setEnableLiveFeed(enable)
storage.setEnableLiveFeed(enable)
}
return (
<UserPreferencesContext.Provider
value={{
@ -102,9 +93,7 @@ export function UserPreferencesProvider({ children }: { children: React.ReactNod
quickReaction,
updateQuickReaction,
quickReactionEmoji,
updateQuickReactionEmoji,
enableLiveFeed,
updateEnableLiveFeed
updateQuickReactionEmoji
}}
>
{children}