Explorar el Código

close all tabs when refresh the question

Arsekl hace 3 años
padre
commit
a24ffd65ae
Se han modificado 1 ficheros con 6 adiciones y 1 borrados
  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([]);