Skip to content

Commit

Permalink
fix: raf
Browse files Browse the repository at this point in the history
Signed-off-by: Innei <tukon479@gmail.com>
  • Loading branch information
Innei committed Mar 26, 2023
1 parent 4c8b4c9 commit b0dd6d4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/atoms/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { apiClient } from '~/utils/client'

import { useUserStore } from './user'

// import './dev'
import './dev'

export interface ViewportRecord {
w: number
Expand Down
4 changes: 4 additions & 0 deletions src/atoms/collections/note.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,12 @@ export const useNoteCollection = createCollection<NoteModel, NoteCollection>(
...note.count,
like: note.count.like + 1,
}

message.success('感谢喜欢!')
state.likeIdList.add(id.toString())
requestAnimationFrame(() => {
getState().addOrPatch(nextNote)
})
setLikeId(`note-${note.nid.toString()}`)
}
})
Expand Down

0 comments on commit b0dd6d4

Please sign in to comment.