Skip to content

Commit ca1d7f7

Browse files
committed
Fix desktop
1 parent 820ebb3 commit ca1d7f7

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

components/JottingsControls/jottingsControl.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,18 @@ export default function JottingsControl(props) {
1616
const [labels, setLabels] = useState(null);
1717

1818
const { width } = useWindowSize();
19-
const [activeList, setActiveList] = useState(typeof width === 'undefined' || width < 800 ? 'labels' : 'all');
19+
const [activeList, setActiveList] = useState('labels');
2020

2121
const router = useRouter();
2222

23+
useEffect(() => {
24+
if (width >= 800) {
25+
setActiveList('all');
26+
} else {
27+
setActiveList('labels');
28+
}
29+
}, [width]);
30+
2331
useEffect(() => {
2432
const onHashChangeStart = (url) => {
2533
const newHash = url.split('#')[1];

0 commit comments

Comments
 (0)