mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-20 14:39:06 +00:00
style cleanup + tweaks
Title <> Subtitle relationships Animat ein
This commit is contained in:
@@ -21,6 +21,7 @@ export default function EventListWrapper() {
|
||||
eventsNamespace,
|
||||
fetchAllEvents
|
||||
);
|
||||
|
||||
const addEvent = useMutation(requestPost, {
|
||||
// we optimistically update here
|
||||
onMutate: async (newEvent) => {
|
||||
@@ -29,10 +30,13 @@ export default function EventListWrapper() {
|
||||
|
||||
// Snapshot the previous value
|
||||
let previousEvents = queryClient.getQueryData(eventsNamespace);
|
||||
console.log('debug', previousEvents)
|
||||
if (previousEvents == null) {
|
||||
await queryClient.refetchQueries();
|
||||
refetch();
|
||||
previousEvents = queryClient.getQueryData(eventsNamespace);
|
||||
}
|
||||
console.log('debug 2', previousEvents)
|
||||
|
||||
// optimistically update object, temp ID until refetch
|
||||
let optimistic = [...previousEvents];
|
||||
optimistic.splice(newEvent.order, 0, {
|
||||
|
||||
Reference in New Issue
Block a user