perf: Slim down logged in round 2 (#20535)
* perf: Slim down loggedInViewer some more * Move locationOptions to apps router * Moved calVideo related handlers to separate router * Moved calendar related handlers to separate router * Rename * Moved deleteCredential to new router * Moved updateProfile to me router * fix unit test * fix e2e test * tweak * missing --------- Co-authored-by: Anik Dhabal Babu <[email protected]> Co-authored-by: unknown <[email protected]>
This commit is contained in:
66 files changed
+240
-205
No files matched your search
@@ -23,7 +23,7 @@ export default function DisconnectIntegration(props: {
|
||||
const [modalOpen, setModalOpen] = useState(false);
|
||||
const utils = trpc.useUtils();
|
||||
|
||||
const mutation = trpc.viewer.deleteCredential.useMutation({
|
||||
const mutation = trpc.viewer.credentials.delete.useMutation({
|
||||
onSuccess: () => {
|
||||
showToast(t("app_removed_successfully"), "success");
|
||||
setModalOpen(false);
|
||||
@@ -34,7 +34,7 @@ export default function DisconnectIntegration(props: {
|
||||
setModalOpen(false);
|
||||
},
|
||||
async onSettled() {
|
||||
await utils.viewer.connectedCalendars.invalidate();
|
||||
await utils.viewer.calendars.connectedCalendars.invalidate();
|
||||
await utils.viewer.apps.integrations.invalidate();
|
||||
},
|
||||
});
|
||||
|
||||
@@ -60,7 +60,7 @@ export const useCalendars = ({ hasSession }: UseCalendarsProps) => {
|
||||
[isError]
|
||||
);
|
||||
|
||||
const { data, isPending } = trpc.viewer.connectedCalendars.useQuery(undefined, {
|
||||
const { data, isPending } = trpc.viewer.calendars.connectedCalendars.useQuery(undefined, {
|
||||
enabled: !!calendarSettingsOverlay || Boolean(searchParams?.get("overlayCalendar")),
|
||||
});
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@ const CalendarSwitch = (props: ICalendarSwitchProps) => {
|
||||
},
|
||||
async onSettled() {
|
||||
await utils.viewer.apps.integrations.invalidate();
|
||||
await utils.viewer.connectedCalendars.invalidate();
|
||||
await utils.viewer.calendars.connectedCalendars.invalidate();
|
||||
},
|
||||
onError() {
|
||||
setCheckedInternal(false);
|
||||
|
||||
@@ -18,7 +18,7 @@ interface Props {
|
||||
value: string | undefined;
|
||||
maxWidth?: number;
|
||||
hideAdvancedText?: boolean;
|
||||
calendarsQueryData?: RouterOutputs["viewer"]["connectedCalendars"];
|
||||
calendarsQueryData?: RouterOutputs["viewer"]["calendars"]["connectedCalendars"];
|
||||
customClassNames?: SelectClassNames;
|
||||
}
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ const getTimeSpan = ({ startTime, endTime, locale, hour12 }: GetTimeSpanProps) =
|
||||
|
||||
const useRecordingDownload = () => {
|
||||
const [recordingId, setRecordingId] = useState("");
|
||||
const { isFetching, data } = trpc.viewer.getDownloadLinkOfCalVideoRecordings.useQuery(
|
||||
const { isFetching, data } = trpc.viewer.calVideo.getDownloadLinkOfCalVideoRecordings.useQuery(
|
||||
{
|
||||
recordingId,
|
||||
},
|
||||
@@ -100,7 +100,7 @@ const ViewRecordingsList = ({ roomName, hasTeamPlan }: { roomName: string; hasTe
|
||||
const { setRecordingId, isFetching, recordingId } = useRecordingDownload();
|
||||
const router = useRouter();
|
||||
|
||||
const { data: recordings } = trpc.viewer.getCalVideoRecordings.useQuery(
|
||||
const { data: recordings } = trpc.viewer.calVideo.getCalVideoRecordings.useQuery(
|
||||
{ roomName },
|
||||
{
|
||||
suspense: true,
|
||||
|
||||
@@ -66,7 +66,7 @@ export default function WorkflowListPage({ workflows }: Props) {
|
||||
const [parent] = useAutoAnimate<HTMLUListElement>();
|
||||
const router = useRouter();
|
||||
|
||||
const mutation = trpc.viewer.workflowOrder.useMutation({
|
||||
const mutation = trpc.viewer.workflows.workflowOrder.useMutation({
|
||||
onError: async (err) => {
|
||||
console.error(err.message);
|
||||
await utils.viewer.workflows.filteredList.cancel();
|
||||
|
||||
@@ -115,7 +115,7 @@ export type EventAdvancedBaseProps = Pick<EventTypeSetupProps, "eventType" | "te
|
||||
|
||||
export type EventAdvancedTabProps = EventAdvancedBaseProps & {
|
||||
calendarsQuery: {
|
||||
data?: RouterOutputs["viewer"]["connectedCalendars"];
|
||||
data?: RouterOutputs["viewer"]["calendars"]["connectedCalendars"];
|
||||
isPending: boolean;
|
||||
error: unknown;
|
||||
};
|
||||
|
||||
@@ -37,7 +37,7 @@ const TimezoneChangeDialogContent = () => {
|
||||
};
|
||||
|
||||
// update timezone in db
|
||||
const mutation = trpc.viewer.updateProfile.useMutation({
|
||||
const mutation = trpc.viewer.me.updateProfile.useMutation({
|
||||
onSuccess: onMutationSuccess,
|
||||
onError: onMutationError,
|
||||
});
|
||||
|
||||
@@ -81,7 +81,7 @@ function EmptyCalendarToggleItem() {
|
||||
|
||||
export function CalendarToggleContainer() {
|
||||
const { t } = useLocale();
|
||||
const { data, isLoading } = trpc.viewer.connectedCalendars.useQuery();
|
||||
const { data, isLoading } = trpc.viewer.calendars.connectedCalendars.useQuery();
|
||||
|
||||
const hasConnectedCalendars = data && data?.connectedCalendars.length > 0;
|
||||
|
||||
|
||||
Reference in new issue
Block a user