Skip to content

Commit 164d2f6

Browse files
committed
Fix types
1 parent 15497a7 commit 164d2f6

File tree

1 file changed

+23
-16
lines changed
  • packages/app/src/app/overmind/effects

1 file changed

+23
-16
lines changed

packages/app/src/app/overmind/effects/router.ts

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,29 @@ export default {
1515
}) {
1616
window.history.replaceState({}, null, sandboxUrl({ id, alias, git }));
1717
},
18-
updateSandboxUrl({
19-
id,
20-
alias,
21-
git,
22-
}: {
23-
id?: string;
24-
alias?: string;
25-
git?: GitInfo;
26-
}) {
27-
history.push(
28-
sandboxUrl({
29-
id,
30-
alias,
31-
git,
32-
})
33-
);
18+
updateSandboxUrl(
19+
{
20+
id,
21+
alias,
22+
git,
23+
}: {
24+
id?: string;
25+
alias?: string;
26+
git?: GitInfo;
27+
},
28+
{ openInNewWindow = false }: { openInNewWindow?: boolean } = {}
29+
) {
30+
const url = sandboxUrl({
31+
id,
32+
alias,
33+
git,
34+
});
35+
36+
if (openInNewWindow) {
37+
window.open(url, '_blank');
38+
} else {
39+
history.push(url);
40+
}
3441
},
3542
redirectToNewSandbox() {
3643
history.push('/s/new');

0 commit comments

Comments
 (0)