Skip to content

Commit 85cd8e9

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

File tree

1 file changed

+7
-28
lines changed

1 file changed

+7
-28
lines changed

site/src/pages/TaskPage/TaskAppIframe.tsx

Lines changed: 7 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,11 @@ import {
66
DropdownMenuItem,
77
DropdownMenuTrigger,
88
} from "components/DropdownMenu/DropdownMenu";
9-
import {
10-
EllipsisVertical,
11-
ExternalLinkIcon,
12-
HouseIcon,
13-
RotateCwIcon,
14-
} from "lucide-react";
15-
import { openAppInNewWindow } from "modules/apps/apps";
9+
import { EllipsisVertical, ExternalLinkIcon, HouseIcon } from "lucide-react";
1610
import { useAppLink } from "modules/apps/useAppLink";
1711
import type { Task } from "modules/tasks/tasks";
1812
import { type FC, useRef } from "react";
13+
import { Link as RouterLink } from "react-router-dom";
1914
import { cn } from "utils/cn";
2015

2116
type TaskAppIFrameProps = {
@@ -64,20 +59,6 @@ export const TaskAppIFrame: FC<TaskAppIFrameProps> = ({
6459
return (
6560
<div className={cn([active ? "flex" : "hidden", "w-full h-full flex-col"])}>
6661
<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-
8162
<Button
8263
size="icon"
8364
variant="subtle"
@@ -104,13 +85,11 @@ export const TaskAppIFrame: FC<TaskAppIFrameProps> = ({
10485
</Button>
10586
</DropdownMenuTrigger>
10687
<DropdownMenuContent align="end">
107-
<DropdownMenuItem
108-
onClick={() => {
109-
openAppInNewWindow(frameSrc);
110-
}}
111-
>
112-
<ExternalLinkIcon />
113-
Open app in new tab
88+
<DropdownMenuItem asChild>
89+
<RouterLink to={frameSrc} target="_blank">
90+
<ExternalLinkIcon />
91+
Open app in new tab
92+
</RouterLink>
11493
</DropdownMenuItem>
11594
</DropdownMenuContent>
11695
</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