Jelajahi Sumber

close all tabs when refresh the question

Arsekl 3 tahun lalu
induk
melakukan
a24ffd65ae
1 mengubah file dengan 6 tambahan dan 1 penghapusan
  1. 6 1
      src/extensions/init.tsx

+ 6 - 1
src/extensions/init.tsx

@@ -151,8 +151,13 @@ function initExplorer() {
         data: explorerData,
     });
     molecule.explorer.onPanelToolbarClick((panel, toolbarId) => {
-        if (toolbarId === "refresh" && store.getState().loadQuestion.examId)
+        if (toolbarId === "refresh" && store.getState().loadQuestion.examId) {
+            const groups = molecule.editor.getState().groups
+            groups?.forEach((group) => {
+                molecule.editor.closeAll(group.id)
+            })
             getQuestion(store.getState().loadQuestion.examId as unknown as string, store.getState().loadQuestion.codeList![0].questionId as unknown as string)
+        }
     })
     molecule.explorer.onCollapseAllFolders(() => {
         molecule.folderTree.setExpandKeys([]);