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:
cv
2021-04-24 10:32:19 +02:00
parent 11fca1ab6d
commit ea92fc7de7
44 changed files with 835 additions and 572 deletions
@@ -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, {