Skip to content

Commit 328947d

Browse files
committed
Use the dashboard url instead of the API url for the View logs link
1 parent 279717b commit 328947d

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

.changeset/poor-flowers-cross.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"trigger.dev": patch
3+
---
4+
5+
Use the dashboard url instead of the API url for the View logs link

packages/cli-v3/src/commands/dev.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,15 +112,16 @@ export async function devCommand(dir: string, options: DevCommandOptions) {
112112
return;
113113
}
114114

115-
const devInstance = await startDev(dir, options, authorization.auth);
115+
const devInstance = await startDev(dir, options, authorization.auth, authorization.dashboardUrl);
116116
const { waitUntilExit } = devInstance.devReactElement;
117117
await waitUntilExit();
118118
}
119119

120120
async function startDev(
121121
dir: string,
122122
options: DevCommandOptions,
123-
authorization: { apiUrl: string; accessToken: string }
123+
authorization: { apiUrl: string; accessToken: string },
124+
dashboardUrl: string
124125
) {
125126
let rerender: (node: React.ReactNode) => void | undefined;
126127

@@ -174,6 +175,7 @@ async function startDev(
174175

175176
return (
176177
<DevUI
178+
dashboardUrl={dashboardUrl}
177179
config={configParam}
178180
apiUrl={apiUrl}
179181
apiKey={devEnv.data.apiKey}
@@ -209,6 +211,7 @@ async function startDev(
209211

210212
type DevProps = {
211213
config: ResolvedConfig;
214+
dashboardUrl: string;
212215
apiUrl: string;
213216
apiKey: string;
214217
environmentClient: CliApiClient;
@@ -220,6 +223,7 @@ type DevProps = {
220223

221224
function useDev({
222225
config,
226+
dashboardUrl,
223227
apiUrl,
224228
apiKey,
225229
environmentClient,
@@ -251,7 +255,7 @@ function useDev({
251255
});
252256

253257
const backgroundWorkerCoordinator = new BackgroundWorkerCoordinator(
254-
`${apiUrl}/projects/v3/${config.project}`
258+
`${dashboardUrl}/projects/v3/${config.project}`
255259
);
256260

257261
websocket.addEventListener("open", async (event) => {});

0 commit comments

Comments
 (0)