Skip to content

Commit 1c74be4

Browse files
author
Jake Wood
committed
fix: new url obj
1 parent 7ab8ef4 commit 1c74be4

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { LoginRequestEvent } from "./messaging/incoming";
1+
import { LoginRequestEvent, NavigateRequestEvent } from "./messaging/incoming";
22

33
export interface TestBoxConfig {
44
allowFullStory?: boolean;
@@ -8,7 +8,7 @@ export interface TestBoxConfig {
88
healthCheckInterval?: number;
99
window?: Window;
1010

11-
onNavigateRequest?: (url: string) => void;
11+
onNavigateRequest?: (url: NavigateRequestEvent) => void;
1212
onLoginRequest?: (props: LoginRequestEvent) => void;
1313
}
1414

src/messaging/incoming.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,6 @@ export type UnionedIncomingMessages =
5151

5252
export type IncomingEventMap = {
5353
[INITIALIZE]: InitializeRequestEvent;
54-
[NAVIGATE_REQUEST_EVENT]: string;
54+
[NAVIGATE_REQUEST_EVENT]: NavigateRequestEvent;
5555
[LOGIN_REQUEST]: LoginRequestEvent;
5656
};

src/router.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export function routeMessage(
3030
initializeTestBox(testbox.data);
3131
break;
3232
case NAVIGATE_REQUEST_EVENT:
33-
window.location.href = testbox.data;
33+
window.location.href = testbox.data.url;
3434
break;
3535
default:
3636
warn("no-route");

0 commit comments

Comments
 (0)