1
0
mirror of https://github.com/tooot-app/app synced 2025-06-05 22:19:13 +02:00

Editing can update media

This commit is contained in:
Zhiyuan Zheng
2022-04-30 21:29:08 +02:00
parent d4f91a5756
commit f93d6f7db8
9 changed files with 666 additions and 746 deletions

View File

@ -7,15 +7,12 @@ const editItem = ({
rootQueryKey,
status
}: MutationVarsTimelineEditItem) => {
console.log('START')
queryKey &&
queryClient.setQueryData<InfiniteData<any> | undefined>(queryKey, old => {
if (old) {
old.pages = old.pages.map(page => {
page.body = page.body.map((item: Mastodon.Status) => {
if (item.id === status.id) {
console.log('found queryKey', queryKey)
console.log('new content', status.content)
item = status
}
return item
@ -34,8 +31,6 @@ const editItem = ({
old.pages = old.pages.map(page => {
page.body = page.body.map((item: Mastodon.Status) => {
if (item.id === status.id) {
console.log('found rootQueryKey', queryKey)
console.log('new content', status.content)
item = status
}
return item
@ -46,7 +41,6 @@ const editItem = ({
}
}
)
console.log('EDN')
}
export default editItem