save compact mode on localstorage#1918
Conversation
65437db to
5a7d988
Compare
There was a problem hiding this comment.
Please move the localStorage handling to the store where toggleCompactMode is actually taking place.
The getItem can then also be fetched as initial value for the store data.
There was a problem hiding this comment.
How to add an created function in the main.js store to fetch the store data?
There was a problem hiding this comment.
You can't and don't need one. You can just set it in the initial state of the store.
There was a problem hiding this comment.
How to do this? This is not working (main.js)
state: {
showArchived: false,
navShown: true,
compactMode: localStorage.getItem('deck.compactMode'),
There was a problem hiding this comment.
You don't set it in your current pull request, once it is set that works like a charm here.
There was a problem hiding this comment.
Changed it, it's not working for me.
On every page reload it's compact
5a7d988 to
f6ab10f
Compare
Codecov Report
@@ Coverage Diff @@
## master #1918 +/- ##
=======================================
Coverage 56.92% 56.92%
=======================================
Files 77 77
Lines 3842 3842
=======================================
Hits 2187 2187
Misses 1655 1655 |
Signed-off-by: Jakob Röhrl <jakob.roehrl@web.de>
f6ab10f to
ead0235
Compare
Signed-off-by: Jakob Röhrl jakob.roehrl@web.de