Skip to content

Commit 1aabb61

Browse files
committed
fix for safari with window.open
1 parent f973b5c commit 1aabb61

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

app/components/videos-board.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ export function VideosBoard({ videos }: { videos: Video[] }) {
3939
throw new Error("URL is null");
4040
}
4141

42-
window.open(url);
42+
setTimeout(() => {
43+
window.open(url);
44+
});
4345
} catch {
4446
toast.error("Unable to download video at this time", {
4547
description: videoTitle,

app/routes/pricing.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,9 @@ function PriceButton({ tier, interval }: PriceButtonProps) {
230230
{
231231
loading: "Getting checkout URL...",
232232
success: (data) => {
233-
window.open(data.url, "_blank");
233+
setTimeout(() => {
234+
window.open(data.url, "_blank");
235+
});
234236
return "Redirecting to checkout...";
235237
},
236238
error: "Unable to get checkout URL. Please try again later.",
@@ -240,7 +242,9 @@ function PriceButton({ tier, interval }: PriceButtonProps) {
240242
toast.promise(getCustomerPortalUrl(), {
241243
loading: "Getting customer portal URL...",
242244
success: (data) => {
243-
window.open(data.url, "_blank");
245+
setTimeout(() => {
246+
window.open(data.url, "_blank");
247+
});
244248
return "Redirecting to customer portal...";
245249
},
246250
error: "Unable to get customer portal URL. Please try again later.",

0 commit comments

Comments
 (0)