Commit f25ddf27 authored by Chunchi Che's avatar Chunchi Che

fix small

parent b201cb28
...@@ -23,18 +23,21 @@ const localStore = proxy(defaultProps); ...@@ -23,18 +23,21 @@ const localStore = proxy(defaultProps);
export const EndModal: React.FC = () => { export const EndModal: React.FC = () => {
const { isOpen, isWin, reason } = useSnapshot(localStore); const { isOpen, isWin, reason } = useSnapshot(localStore);
const { isReplay } = useSnapshot(matStore);
return ( return (
<NeosModal <NeosModal
title={fetchStrings("!system", 1500)} title={fetchStrings("!system", 1500)}
open={isOpen} open={isOpen}
onOk={() => { onOk={() => {
const replayBuffers = replayStore.encode(); if (!isReplay) {
const blob = new Blob(replayBuffers, { const replayBuffers = replayStore.encode();
type: "application/octet-stream", const blob = new Blob(replayBuffers, {
}); type: "application/octet-stream",
// download the replay file });
window.open(URL.createObjectURL(blob)); // download the replay file
window.open(URL.createObjectURL(blob));
}
rs(); rs();
}} }}
onCancel={() => { onCancel={() => {
...@@ -44,7 +47,7 @@ export const EndModal: React.FC = () => { ...@@ -44,7 +47,7 @@ export const EndModal: React.FC = () => {
> >
<p>{isWin ? "Win" : "Defeated"}</p> <p>{isWin ? "Win" : "Defeated"}</p>
<p>{reason}</p> <p>{reason}</p>
{matStore.isReplay ? <></> : <p>{fetchStrings("!system", 1340)}</p>} {isReplay ? <></> : <p>{fetchStrings("!system", 1340)}</p>}
</NeosModal> </NeosModal>
); );
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment