From 9bb65a9704342bec171077890c6fee29ee696550 Mon Sep 17 00:00:00 2001 From: David Ralph Date: Sat, 11 Mar 2023 17:06:17 +0000 Subject: [PATCH] fix: todo, photo packs Co-authored-by: Alex Sparkes --- src/components/widgets/navbar/Todo.jsx | 33 ++++++++++++++++---------- 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/src/components/widgets/navbar/Todo.jsx b/src/components/widgets/navbar/Todo.jsx index 9fe1b206..92285672 100644 --- a/src/components/widgets/navbar/Todo.jsx +++ b/src/components/widgets/navbar/Todo.jsx @@ -6,6 +6,8 @@ import { MdDelete, MdPlaylistAdd, MdOutlineDragIndicator, + MdOutlineTextsms, + MdAdd } from 'react-icons/md'; import TextareaAutosize from '@mui/material/TextareaAutosize'; import Tooltip from '../../helpers/tooltip/Tooltip'; @@ -21,12 +23,7 @@ class Todo extends PureComponent { constructor() { super(); this.state = { - todo: JSON.parse(localStorage.getItem('todoContent')) || [ - { - value: '', - done: false, - }, - ], + todo: JSON.parse(localStorage.getItem('todoContent')) || [], visibility: localStorage.getItem('todoPinned') === 'true' ? 'visible' : 'hidden', marginLeft: localStorage.getItem('refresh') === 'false' ? '-200px' : '-130px', showTodo: localStorage.getItem('todoPinned') === 'true', @@ -93,12 +90,6 @@ class Todo extends PureComponent { break; case 'remove': todo.splice(index, 1); - if (todo.length === 0) { - todo.push({ - value: '', - done: false, - }); - } break; case 'set': todo[index] = { @@ -170,6 +161,23 @@ class Todo extends PureComponent {
+ {this.state.todo.length === 0 ? ( +
+
+ + + {variables.getMessage('modals.main.settings.sections.message.no_messages')} + + + {variables.getMessage('modals.main.settings.sections.message.add_some')} + + +
+
+ ) : ))} + }