@@ -3,7 +3,7 @@ Main component of the application.
33Combines the code editor and the gui editor.
44-->
55<script lang="ts" setup>
6- import {computed , onMounted , onUnmounted , type Ref , ref , watch } from ' vue' ;
6+ import {computed , onMounted , onUnmounted , ref , watch } from ' vue' ;
77import ' primeicons/primeicons.css' ;
88import SplitterPanel from ' primevue/splitterpanel' ;
99import Splitter from ' primevue/splitter' ;
@@ -15,13 +15,13 @@ import {useConfirm} from 'primevue/useconfirm';
1515import {confirmationService } from ' @/utility/confirmationService' ;
1616import {toastService } from ' @/utility/toastService' ;
1717import {useAppRouter } from ' @/router/router' ;
18- import {useDropZone , useWindowSize , watchImmediate } from ' @vueuse/core/index ' ;
18+ import {useDropZone , useWindowSize , watchImmediate } from ' @vueuse/core' ;
1919import {readFileContentToDataLink } from ' @/utility/readFileContent' ;
2020import {getDataForMode } from ' @/data/useDataLink' ;
2121import {useSettings } from ' @/settings/useSettings' ;
2222import {modeToRoute , SessionMode } from ' @/store/sessionMode' ;
2323import {useSessionStore } from ' @/store/sessionStore' ;
24- import type {SettingsInterfacePanels , SettingsInterfaceRoot } from ' @/settings/settingsTypes' ;
24+ import type {SettingsInterfacePanels } from ' @/settings/settingsTypes' ;
2525import {SETTINGS_DATA_DEFAULT } from ' @/settings/defaultSettingsData' ;
2626import {updateSettingsWithDefaults } from ' @/settings/settingsUpdater' ;
2727import {panelTypeRegistry } from ' @/components/panels/panelTypeRegistry' ;
@@ -37,16 +37,18 @@ let panelsDefinition: SettingsInterfacePanels = settings.value.panels;
3737// any setting is changed, which is not necessary and leads to Ace Editor becoming blank if settings were modified via
3838// Ace Editor
3939watchImmediate (
40- () => settings ,
41- ( settings : Ref < SettingsInterfaceRoot >) => {
42- let panels = settings . value .panels ;
40+ () => settings . value ,
41+ newSettings => {
42+ const panels = newSettings .panels ;
4343 if (JSON .stringify (panels ) !== JSON .stringify (panelsDefinition )) {
4444 panelsDefinition = panels ;
4545 }
4646 // fix panels if they are not defined
4747 for (let mode of Object .values (SessionMode )) {
4848 if (! panels [mode ]) {
49- panels [mode ] = structuredClone (SETTINGS_DATA_DEFAULT .panels [mode ]);
49+ panels [mode ] = structuredClone (
50+ SETTINGS_DATA_DEFAULT .panels [mode ]
51+ ) as SettingsInterfacePanels [typeof mode ];
5052 }
5153 }
5254 }
@@ -164,10 +166,10 @@ onUnmounted(() => {
164166 class =" h-full"
165167 style =" min-width : 0 "
166168 :layout =" width < 600 ? 'vertical' : 'horizontal'"
167- :key =" panels " >
169+ :key =" props.sessionMode " >
168170 <SplitterPanel
169171 v-for =" (panel, index) in panels"
170- :key =" index + panel"
172+ :key =" `${ panel.sessionMode}-${index}` "
171173 :min-size =" 10"
172174 :size =" panel.size"
173175 :resizable =" true" >
0 commit comments