From c2b0bfbdb371c63892bd90ebea08fb954f0fb049 Mon Sep 17 00:00:00 2001 From: linlu <527100546@qq.com> Date: Sat, 8 Oct 2022 10:57:52 +0800 Subject: [PATCH] fix --- src/routes/tasks/code-game/index.jsx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/routes/tasks/code-game/index.jsx b/src/routes/tasks/code-game/index.jsx index e8701a9..9440e0e 100644 --- a/src/routes/tasks/code-game/index.jsx +++ b/src/routes/tasks/code-game/index.jsx @@ -175,9 +175,14 @@ export default ({ source, taskId }) => { setCode({ ...response.data }) - lastedValue.current = window.decodeURIComponent( - escape(window.atob(content?.content))) - setEditValue(lastedValue.current) + if(content?.content && content?.content != ""){ + lastedValue.current = window.decodeURIComponent( + escape(window.atob(content?.content))) + setEditValue(lastedValue.current) + }else{ + lastedValue.current = "" + } + } if (taskId) {