mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-17 21:24:11 +00:00
refractor + style tweaks
- bugfix on lower - delay between 0-60 minutes - action buttons in dropdown - added button for toggling element visibility - several css and code cleanups - renamed settingsAPI
This commit is contained in:
@@ -24,11 +24,14 @@ export default function EventListWrapper() {
|
||||
// we optimistically update here
|
||||
onMutate: async (newEvent) => {
|
||||
// cancel ongoing queries
|
||||
queryClient.cancelQueries(eventsNamespace);
|
||||
queryClient.cancelQueries(eventsNamespace, { exact: true });
|
||||
|
||||
// Snapshot the previous value
|
||||
const previousEvents = queryClient.getQueryData(eventsNamespace);
|
||||
|
||||
let previousEvents = queryClient.getQueryData(eventsNamespace);
|
||||
if (previousEvents == null) {
|
||||
await queryClient.refetchQueries();
|
||||
previousEvents = queryClient.getQueryData(eventsNamespace);
|
||||
}
|
||||
// optimistically update object, temp ID until refetch
|
||||
let optimistic = [...previousEvents];
|
||||
optimistic.splice(newEvent.order, 0, {
|
||||
|
||||
Reference in New Issue
Block a user