Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions apps/web/modules/auth/forgot-password/forgot-password-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,18 @@ export default function ForgotPassword(props: PageProps) {
}
};

const debouncedHandleSubmitPasswordRequest = debounce(submitForgotPasswordRequest, 250);
const submitRef = React.useRef(submitForgotPasswordRequest);
submitRef.current = submitForgotPasswordRequest;

const handleSubmit = async (e: SyntheticEvent) => {
const debouncedHandleSubmitPasswordRequest = React.useRef(
debounce((args: { email: string }) => submitRef.current(args), 250)
).current;

React.useEffect(() => {
return () => debouncedHandleSubmitPasswordRequest.cancel();
}, []);

const handleSubmit = (e: SyntheticEvent) => {
e.preventDefault();

if (!email) {
Expand All @@ -71,7 +80,7 @@ export default function ForgotPassword(props: PageProps) {
setError(null);
setSuccess(false);

await debouncedHandleSubmitPasswordRequest({ email });
debouncedHandleSubmitPasswordRequest({ email });
};

const Success = () => {
Expand Down
4 changes: 4 additions & 0 deletions packages/embeds/embed-core/src/embed-iframe/lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ export function keepParentInformedAboutDimensionChanges({ embedStore }: { embedS
let isInitialDimensionPass = true;
let isWindowLoadComplete = false;
runAsap(function informAboutScroll() {
// Can't inform parent about dimensions if document doesn't exist
if (typeof document === "undefined") {
return;
}
if (document.readyState !== "complete") {
// Wait for window to load to correctly calculate the initial scroll height.
runAsap(informAboutScroll);
Expand Down
9 changes: 7 additions & 2 deletions packages/features/users/lib/getRoutedUsers.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { describe, it, expect, vi } from "vitest";

import { describe, expect, it, vi } from "vitest";
import { getRoutedUsersWithContactOwnerAndFixedUsers } from "./getRoutedUsers";

vi.mock("@calcom/prisma", () => {
Expand All @@ -8,6 +7,12 @@ vi.mock("@calcom/prisma", () => {
};
});

vi.mock("@calcom/app-store/delegationCredential", () => {
return {
enrichHostsWithDelegationCredentials: vi.fn().mockResolvedValue([]),
};
});

describe("getRoutedUsersWithContactOwnerAndFixedUsers", () => {
const users = [
{ id: 1, email: "user1@example.com", isFixed: false },
Expand Down
Loading