Skip to content

Commit d44eba3

Browse files
johanbookJohan Book
and
Johan Book
authored
fix(web-ui): fix cache issue when creating new chat (#907)
* fix(web-ui): fix cache issue when creating new chat * chore(repo): schedule watchtower deploys --------- Co-authored-by: Johan Book <{ID}+{username}@users.noreply.github.com>
1 parent 068c324 commit d44eba3

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

docker-compose.prod.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ services:
110110
container_name: watchtower
111111
command:
112112
- "--cleanup"
113-
- "--interval"
114-
- "3600"
113+
- "--schedule"
114+
- "0 0 * * * * *"
115115
volumes:
116116
- /var/run/docker.sock:/var/run/docker.sock
117117

services/web-ui/src/features/chat/pages/CreateChatPage/CreateChatPage.container.tsx

+9-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,12 @@ import { chatsApi, organizationsApi, profileApi } from "src/apis";
77
import { ProfileAvatar } from "src/components/ProfileAvatar";
88
import { Button } from "src/components/ui";
99
import { useTranslation } from "src/core/i18n";
10-
import { CacheKeysConstants, useMutation, useQuery } from "src/core/query";
10+
import {
11+
CacheKeysConstants,
12+
useMutation,
13+
useQuery,
14+
useQueryClient,
15+
} from "src/core/query";
1116
import { useSnackbar } from "src/core/snackbar";
1217
import { ErrorView } from "src/views/ErrorView";
1318

@@ -25,6 +30,8 @@ export function CreateChatPageContainer(): ReactElement {
2530
const snackbar = useSnackbar();
2631
const { t } = useTranslation("chat-create");
2732

33+
const queryClient = useQueryClient();
34+
2835
const { error, data, isPending } = useQuery({
2936
queryKey: ["members"],
3037
queryFn: () => organizationsApi.getCurrentOrganizationMembers(),
@@ -40,6 +47,7 @@ export function CreateChatPageContainer(): ReactElement {
4047
const createChatMutation = useMutation({
4148
onError: () => snackbar.error(t("create.error")),
4249
onSuccess: () => {
50+
queryClient.invalidateQueries({ queryKey: [CacheKeysConstants.Chats] });
4351
snackbar.success(t("create.success"));
4452
navigate("/chat");
4553
},

0 commit comments

Comments
 (0)