fix: default conferencing app not showing the correct value after updated (#7589)

* fix: edge case

* feat: add overflow

* fix: invalidate cache
pull/7098/head^2
Nafees Nazik 2023-03-08 21:47:08 +05:30 committed by GitHub
parent e836a042e9
commit 0ee3b26ca8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 4 deletions

View File

@ -69,7 +69,10 @@ const ConferencingLayout = () => {
}, []);
const updateDefaultAppMutation = trpc.viewer.updateUserDefaultConferencingApp.useMutation({
onSuccess: onSuccessCallback,
onSuccess: async () => {
await utils.viewer.getUsersDefaultConferencingApp.invalidate();
onSuccessCallback();
},
onError: (error) => {
showToast(`Error: ${error.message}`, "error");
},

View File

@ -37,7 +37,8 @@ export function BulkEditDefaultConferencingModal(props: { open: boolean; setOpen
<DialogContent
type="creation"
title={t("default_conferencing_bulk_title")}
description={t("default_conferencing_bulk_description")}>
description={t("default_conferencing_bulk_description")}
enableOverflow>
<Form
form={form}
handleSubmit={(values) => {

View File

@ -844,8 +844,14 @@ export const eventTypesRouter = router({
});
const eventTypesWithLogo = eventTypes.map((eventType) => {
const locationParsed = eventTypeLocationsSchema.parse(eventType.locations);
const app = getAppFromLocationValue(locationParsed[0].type);
const locationParsed = eventTypeLocationsSchema.safeParse(eventType.locations);
// some events has null as location for legacy reasons, so this fallbacks to daily video
const app = getAppFromLocationValue(
locationParsed.success && locationParsed.data?.[0]?.type
? locationParsed.data[0].type
: "integrations:daily"
);
return {
...eventType,
logo: app?.logo,
@ -856,6 +862,7 @@ export const eventTypesRouter = router({
eventTypes: eventTypesWithLogo,
};
}),
bulkUpdateToDefaultLocation: authedProcedure
.input(
z.object({