🔥 Remove caching and async persistance storage

This commit is contained in:
Manuel
2023-07-30 22:30:49 +02:00
parent f61d0f5f8d
commit 0575cd475c
6 changed files with 37 additions and 172 deletions

View File

@@ -1,63 +0,0 @@
import { Button, Group, MultiSelect, Stack, Title } from '@mantine/core';
import { notifications } from '@mantine/notifications';
import { IconTrash } from '@tabler/icons-react';
import { useState } from 'react';
import { queryClient } from '../../../tools/server/configurations/tanstack/queryClient.tool';
const data = [
{ value: 'ping', label: 'Ping queries' },
{ value: 'repository-icons', label: 'Remote/Local icons' },
{ value: 'calendar/medias', label: 'Medais from the Calendar' },
{ value: 'weather', label: 'Weather data' },
];
export function CacheButtons() {
const [value, setValue] = useState<string[]>([]);
return (
<Stack spacing="xs">
<Title order={4}>Cache cleaning</Title>
<MultiSelect
value={value}
searchable
onChange={setValue}
data={data}
label="Select the cache(s) to clear"
/>
<Group>
<Button
color="red"
variant="light"
onClick={() =>
queryClient.invalidateQueries(value).then(() =>
notifications.show({
title: 'Cache cleared',
message: `Cache for ${value.join(', ')} has been cleared`,
color: 'teal',
icon: <IconTrash />,
autoClose: 5000,
})
)
}
>
Clear selected queries
</Button>
<Button
onClick={() =>
queryClient.invalidateQueries().then(() =>
notifications.show({
title: 'Cache cleared',
message: 'All cache has been cleared',
color: 'teal',
icon: <IconTrash />,
autoClose: 5000,
})
)
}
>
Clear all cache
</Button>
</Group>
</Stack>
);
}

View File

@@ -26,7 +26,6 @@ export default function CommonSettings() {
<Space />
<LanguageSelect />
<ConfigChanger />
<CacheButtons />
<ConfigActions />
</Stack>
</ScrollArea>