Skip to content

Commit 6ae6efe

Browse files
committed
Apply PR review suggestions
1 parent b707977 commit 6ae6efe

File tree

3 files changed

+5
-14
lines changed

3 files changed

+5
-14
lines changed

site/src/modules/apps/apps.ts

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import { generateRandomString } from "utils/random";
2-
31
type GetVSCodeHrefParams = {
42
owner: string;
53
workspace: string;
@@ -52,9 +50,5 @@ export const getTerminalHref = ({
5250
};
5351

5452
export const openAppInNewWindow = (name: string, href: string) => {
55-
window.open(
56-
href,
57-
`${name} - ${generateRandomString(12)}`,
58-
"width=900,height=600",
59-
);
53+
window.open(href, "_blank", "width=900,height=600");
6054
};

site/src/modules/resources/VSCodeDesktopButton/VSCodeDesktopButton.tsx

+2-6
Original file line numberDiff line numberDiff line change
@@ -119,15 +119,13 @@ const VSCodeButton: FC<VSCodeDesktopButtonProps> = ({
119119
setLoading(true);
120120
API.getApiKey()
121121
.then(({ key }) => {
122-
const href = getVSCodeHref("vscode", {
122+
location.href = getVSCodeHref("vscode", {
123123
owner: userName,
124124
workspace: workspaceName,
125125
token: key,
126126
agent: agentName,
127127
folder: folderPath,
128128
});
129-
130-
location.href = href;
131129
})
132130
.catch((ex) => {
133131
console.error(ex);
@@ -158,15 +156,13 @@ const VSCodeInsidersButton: FC<VSCodeDesktopButtonProps> = ({
158156
setLoading(true);
159157
API.getApiKey()
160158
.then(({ key }) => {
161-
const href = getVSCodeHref("vscode-insiders", {
159+
location.href = getVSCodeHref("vscode-insiders", {
162160
owner: userName,
163161
workspace: workspaceName,
164162
token: key,
165163
agent: agentName,
166164
folder: folderPath,
167165
});
168-
169-
location.href = href;
170166
})
171167
.catch((ex) => {
172168
console.error(ex);

site/src/pages/WorkspacesPage/WorkspacesTable.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,6 @@ type WorkspaceAppsProps = {
638638
};
639639

640640
const WorkspaceApps: FC<WorkspaceAppsProps> = ({ workspace }) => {
641-
const buttons: ReactNode[] = [];
642641
const { data: apiKeyRes } = useQuery(apiKey());
643642
const token = apiKeyRes?.key;
644643

@@ -654,6 +653,8 @@ const WorkspaceApps: FC<WorkspaceAppsProps> = ({ workspace }) => {
654653
return null;
655654
}
656655

656+
const buttons: ReactNode[] = [];
657+
657658
if (agent.display_apps.includes("vscode")) {
658659
buttons.push(
659660
<AppLink

0 commit comments

Comments
 (0)