Skip to content

Scheduling infrastructure for absolutely everyone.

fix: add toast and fix delete action (#5912)

Udit Takkarcc9b49131e4f
diff --git a/apps/web/pages/settings/my-account/calendars.tsx b/apps/web/pages/settings/my-account/calendars.tsx
index 4bd8d73ed3c..12929b0f78f 100644
--- a/apps/web/pages/settings/my-account/calendars.tsx
+++ b/apps/web/pages/settings/my-account/calendars.tsx
@@ -22,6 +22,7 @@ import {
SkeletonButton,
SkeletonContainer,
SkeletonText,
+ showToast,
} from "@calcom/ui";
import { QueryCell } from "@lib/QueryCell";
@@ -66,6 +67,12 @@ const CalendarsView = () => {
async onSettled() {
await utils.viewer.connectedCalendars.invalidate();
},
+ onSuccess: async () => {
+ showToast(t("calendar_updated_successfully"), "success");
+ },
+ onError: () => {
+ showToast(t("unexpected_error_try_again"), "error");
+ },
});
return (
diff --git a/apps/web/public/static/locales/en/common.json b/apps/web/public/static/locales/en/common.json
index de2d67aedbc..0d957b7377c 100644
--- a/apps/web/public/static/locales/en/common.json
+++ b/apps/web/public/static/locales/en/common.json
@@ -747,6 +747,7 @@
"toggle_calendars_conflict": "Toggle the calendars you want to check for conflicts to prevent double bookings.",
"select_destination_calendar": "Create events on",
"connect_additional_calendar": "Connect additional calendar",
+ "calendar_updated_successfully":"Calendar updated successfully",
"conferencing": "Conferencing",
"calendar": "Calendar",
"payments": "Payments",
diff --git a/packages/features/apps/components/DisconnectIntegration.tsx b/packages/features/apps/components/DisconnectIntegration.tsx
index 083de6da17b..d9a31a95543 100644
--- a/packages/features/apps/components/DisconnectIntegration.tsx
+++ b/packages/features/apps/components/DisconnectIntegration.tsx
@@ -31,6 +31,7 @@ export default function DisconnectIntegration({
}) {
const { t } = useLocale();
const [modalOpen, setModalOpen] = useState(false);
+ const utils = trpc.useContext();
const mutation = trpc.viewer.deleteCredential.useMutation({
onSuccess: () => {
@@ -42,6 +43,9 @@ export default function DisconnectIntegration({
showToast(t("error_removing_app"), "error");
setModalOpen(false);
},
+ async onSettled() {
+ await utils.viewer.connectedCalendars.invalidate();
+ },
});
return (