From 3230ae3b03323f9d7d27a1a893789f449d4e8bef Mon Sep 17 00:00:00 2001
From: Robin Tissot <tissotrobin@gmail.com>
Date: Thu, 22 Apr 2021 12:04:31 +0200
Subject: [PATCH] Segmentation & Transcription panels are opened by default.

---
 front/src/editor/store/document.js | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/front/src/editor/store/document.js b/front/src/editor/store/document.js
index ee3ffe0a..d24aac33 100644
--- a/front/src/editor/store/document.js
+++ b/front/src/editor/store/document.js
@@ -14,10 +14,10 @@ export const initialState = () => ({
     // Manage panels visibility through booleans
     // Those values are initially populated by localStorage
     visible_panels: {
-        source: userProfile.get('source-panel'),
-        segmentation: userProfile.get('segmentation-panel'),
-        visualisation: userProfile.get('visualisation-panel'),
-        diplomatic: userProfile.get('diplomatic-panel')
+        source: userProfile.get('visible-panels')?userProfile.get('visible-panels').source:false,
+        segmentation: userProfile.get('visible-panels')?userProfile.get('visible-panels').segmentation:true,
+        visualisation: userProfile.get('visible-panels')?userProfile.get('visible-panels').visualisation:true,
+        diplomatic: userProfile.get('visible-panels')?userProfile.get('visible-panels').diplomatic:false
     },
 })
 
@@ -70,7 +70,7 @@ export const actions = {
         commit('setVisiblePanels', update)
 
         // Persist final value in user profile
-        userProfile.set(panel + '-panel', state.visible_panels[panel])
+        userProfile.set('visible-panels', state.visible_panels)
     }
 }
 
-- 
GitLab