From 11df61220bf9a182c8ccf6696613ff67de7fd46b Mon Sep 17 00:00:00 2001 From: Xavier Yuhan Liu Date: Tue, 4 Jun 2024 01:06:59 +0800 Subject: [PATCH] =?UTF-8?q?undo=E7=BB=8F=E5=B8=B8=E4=BA=AE=E7=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src-ui/components/MultifileCode.jsx | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src-ui/components/MultifileCode.jsx b/src-ui/components/MultifileCode.jsx index 030aaa49..a57f8531 100644 --- a/src-ui/components/MultifileCode.jsx +++ b/src-ui/components/MultifileCode.jsx @@ -144,16 +144,20 @@ export default function MultifileCode() { }; const getUndoButtonisDisabled = () => { + // const currentFile = state.files.find( + // file => file.fileName === state.currentFile, + // ); + // if (!currentFile) { + // return true; + // } + // return !currentFile.started; const currentFile = state.files.find( - file => file.fileName === state.currentFile, + file => file.fileName === state.currentFile, ); - if (!currentFile) { - return true; + if (currentFile && currentFile.assembly.length != 0) { + return false; } - // if (currentFile.paused) { - // return true - // } - return !currentFile.started; + return true; }; const getResetButtonisDisabled = () => {