Skip to content

Commit

Permalink
fix(flat-pages): replay button not work in electron (#1764)
Browse files Browse the repository at this point in the history
  • Loading branch information
hyrious authored Nov 9, 2022
1 parent 7d4325d commit 6d0aba3
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/flat-pages/src/RoomDetailPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,14 @@ export const RoomDetailPage = observer(function RoomDetailPage() {
function jumpToReplayPage(): void {
if (roomInfo) {
const { roomType, roomUUID, ownerUUID } = roomInfo;
window.open(`/replay/${roomType}/${roomUUID}/${ownerUUID}/`, "_blank");
if (!roomType) {
return void message.error("Unknown roomType");
}
if (window.isElectron) {
pushHistory(RouteNameType.ReplayPage, { roomType, roomUUID, ownerUUID });
} else {
window.open(`/replay/${roomType}/${roomUUID}/${ownerUUID}/`, "_blank");
}
}
}

Expand Down

0 comments on commit 6d0aba3

Please sign in to comment.