Skip to content

Commit 14674b4

Browse files
committed
Remove reload and use link for new tab
1 parent 35f6d0e commit 14674b4

File tree

1 file changed

+6
-22
lines changed

1 file changed

+6
-22
lines changed

site/src/pages/TaskPage/TaskAppIframe.tsx

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ import {
1212
HouseIcon,
1313
RotateCwIcon,
1414
} from "lucide-react";
15-
import { openAppInNewWindow } from "modules/apps/apps";
1615
import { useAppLink } from "modules/apps/useAppLink";
1716
import type { Task } from "modules/tasks/tasks";
1817
import { type FC, useRef } from "react";
18+
import { Link as RouterLink } from "react-router-dom";
1919
import { cn } from "utils/cn";
2020

2121
type TaskAppIFrameProps = {
@@ -64,20 +64,6 @@ export const TaskAppIFrame: FC<TaskAppIFrameProps> = ({
6464
return (
6565
<div className={cn([active ? "flex" : "hidden", "w-full h-full flex-col"])}>
6666
<div className="bg-surface-tertiary flex items-center p-2 py-1 gap-1">
67-
<Button
68-
size="icon"
69-
variant="subtle"
70-
onClick={(e) => {
71-
e.preventDefault();
72-
if (frameRef.current?.contentWindow) {
73-
frameRef.current.contentWindow.location.reload();
74-
}
75-
}}
76-
>
77-
<RotateCwIcon />
78-
<span className="sr-only">Refresh</span>
79-
</Button>
80-
8167
<Button
8268
size="icon"
8369
variant="subtle"
@@ -104,13 +90,11 @@ export const TaskAppIFrame: FC<TaskAppIFrameProps> = ({
10490
</Button>
10591
</DropdownMenuTrigger>
10692
<DropdownMenuContent align="end">
107-
<DropdownMenuItem
108-
onClick={() => {
109-
openAppInNewWindow(frameSrc);
110-
}}
111-
>
112-
<ExternalLinkIcon />
113-
Open app in new tab
93+
<DropdownMenuItem asChild>
94+
<RouterLink to={frameSrc} target="_blank">
95+
<ExternalLinkIcon />
96+
Open app in new tab
97+
</RouterLink>
11498
</DropdownMenuItem>
11599
</DropdownMenuContent>
116100
</DropdownMenu>

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy