diff --git a/components/bookmark.js b/components/bookmark.js index 2951a4ac..b62c624c 100644 --- a/components/bookmark.js +++ b/components/bookmark.js @@ -17,7 +17,8 @@ export default function BookmarkDropdownItem ({ item: { id, meBookmark } }) { id: `Item:${id}`, fields: { meBookmark: () => bookmarkItem.meBookmark - } + }, + optimistic: true }) } } diff --git a/components/comment-edit.js b/components/comment-edit.js index dc4ea1bd..97c59c1d 100644 --- a/components/comment-edit.js +++ b/components/comment-edit.js @@ -18,7 +18,8 @@ export default function CommentEdit ({ comment, editThreshold, onSuccess, onCanc text () { return result.text } - } + }, + optimistic: true }) } }, diff --git a/components/delete.js b/components/delete.js index 4ab1320d..11892765 100644 --- a/components/delete.js +++ b/components/delete.js @@ -30,7 +30,8 @@ export default function Delete ({ itemId, children, onDelete, type = 'post' }) { url: () => deleteItem.url, pollCost: () => deleteItem.pollCost, deletedAt: () => deleteItem.deletedAt - } + }, + optimistic: true }) } } diff --git a/components/dont-link-this.js b/components/dont-link-this.js index ef058887..c230d8e6 100644 --- a/components/dont-link-this.js +++ b/components/dont-link-this.js @@ -84,7 +84,8 @@ export function OutlawDropdownItem ({ item }) { id: `Item:${item.id}`, fields: { outlawed: () => true - } + }, + optimistic: true }) } } diff --git a/components/item-act.js b/components/item-act.js index 477cf459..3254357b 100644 --- a/components/item-act.js +++ b/components/item-act.js @@ -209,7 +209,8 @@ function modifyActCache (cache, { result, invoice }) { } return existingBoost } - } + }, + optimistic: true }) } @@ -228,7 +229,8 @@ function updateAncestors (cache, { result, invoice }) { commentSats (existingCommentSats = 0) { return existingCommentSats + sats } - } + }, + optimistic: true }) }) } diff --git a/components/pay-bounty.js b/components/pay-bounty.js index 35c5ebe6..b434b925 100644 --- a/components/pay-bounty.js +++ b/components/pay-bounty.js @@ -22,7 +22,8 @@ export const payBountyCacheMods = { bountyPaidTo (existingPaidTo = []) { return [...(existingPaidTo || []), Number(id)] } - } + }, + optimistic: true }) }, onPayError: (e, cache, { data }) => { @@ -36,7 +37,8 @@ export const payBountyCacheMods = { bountyPaidTo (existingPaidTo = []) { return (existingPaidTo || []).filter(i => i !== Number(id)) } - } + }, + optimistic: true }) } } diff --git a/components/poll.js b/components/poll.js index 34276047..d0228333 100644 --- a/components/poll.js +++ b/components/poll.js @@ -123,7 +123,8 @@ export function usePollVote ({ query = POLL_VOTE, itemId }) { poll.count += 1 return poll } - } + }, + optimistic: true }) cache.modify({ id: `PollOption:${id}`, @@ -131,7 +132,8 @@ export function usePollVote ({ query = POLL_VOTE, itemId }) { count (existingCount) { return existingCount + 1 } - } + }, + optimistic: true }) } @@ -154,7 +156,8 @@ export function usePollVote ({ query = POLL_VOTE, itemId }) { poll.count -= 1 return poll } - } + }, + optimistic: true }) cache.modify({ id: `PollOption:${id}`, @@ -162,7 +165,8 @@ export function usePollVote ({ query = POLL_VOTE, itemId }) { count (existingCount) { return existingCount - 1 } - } + }, + optimistic: true }) } diff --git a/components/reply.js b/components/reply.js index 71427b47..752c7316 100644 --- a/components/reply.js +++ b/components/reply.js @@ -78,7 +78,8 @@ export default forwardRef(function Reply ({ }) return [newCommentRef, ...existingCommentRefs] } - } + }, + optimistic: true }) // no lag for itemRepetition @@ -102,7 +103,8 @@ export default forwardRef(function Reply ({ ncomments (existingNComments = 0) { return existingNComments + 1 } - } + }, + optimistic: true }) }) diff --git a/components/subscribe.js b/components/subscribe.js index 32023c85..c800f381 100644 --- a/components/subscribe.js +++ b/components/subscribe.js @@ -17,7 +17,8 @@ export default function SubscribeDropdownItem ({ item: { id, meSubscription } }) id: `Item:${id}`, fields: { meSubscription: () => subscribeItem.meSubscription - } + }, + optimistic: true }) } } diff --git a/components/use-item-submit.js b/components/use-item-submit.js index f460c51a..0135113e 100644 --- a/components/use-item-submit.js +++ b/components/use-item-submit.js @@ -118,7 +118,8 @@ export function useRetryCreateItem ({ id }) { `, data: { bolt11: response.invoice.bolt11 } }) - } + }, + optimistic: true }) paidActionCacheMods?.update?.(cache, { data }) }