Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8fcbf2c

Browse files
authored
fix:Connect atoms not working inside iframe (#25418)
* fix: google connect broken for iframe* chore: add changesets* chore: update atoms exports* chore: update atoms exports
1 parenta050ccb commit8fcbf2c

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

‎.changeset/long-ties-obey.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@calcom/atoms":patch
3+
---
4+
5+
This PR fixes the issue of connect atoms not working inside iframes. It also updates the atoms exports to include the`useAvailableSlots` hook.

‎packages/platform/atoms/hooks/connect/useConnect.ts‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export const useGetRedirectUrl = (
1818
redir?:string,
1919
isDryRun?:boolean
2020
)=>{
21-
constredirectUrl=!!redir ?encodeURIComponent(redir) :"";
21+
constredirectUrl=redir ?encodeURIComponent(redir) :"";
2222

2323
constauthUrl=useQuery({
2424
queryKey:getQueryKey(calendar),
@@ -49,7 +49,15 @@ export const useConnect = (calendar: (typeof CALENDARS)[number], redir?: string,
4949
constredirectUri=awaitrefetch();
5050

5151
if(redirectUri.data){
52-
window.location.href=redirectUri.data;
52+
lettargetWindow;
53+
if(window!==window.top&&window.top){
54+
// if its an iframe, the target window should be the parent window
55+
targetWindow=window.top;
56+
}else{
57+
targetWindow=window;
58+
}
59+
60+
targetWindow.location.href=redirectUri.data;
5361
}
5462
};
5563

‎packages/platform/atoms/index.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,5 @@ export { CreateSchedulePlatformWrapper as CreateSchedule } from "./create-schedu
4848
export{CreateScheduleForm}from"./create-schedule/CreateScheduleForm";
4949

5050
export{ListSchedulesPlatformWrapperasListSchedules}from"./list-schedules/index";
51+
52+
export{useAvailableSlots}from"./hooks/useAvailableSlots";

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp