File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11{
22 "name" : " flyingtodo" ,
3- "version" : " 1.3.1 " ,
3+ "version" : " 1.3.2 " ,
44 "description" : " A TODO list application to learn JS, that I will maybe continue later." ,
55 "main" : " main.js" ,
66 "scripts" : {
Original file line number Diff line number Diff line change @@ -137,7 +137,7 @@ function refreshToDo() {
137137 containertags . innerHTML = '<button class="addtagbutton">+</button>' ;
138138
139139 const addtagbutton = divtodo . querySelector ( '.addtagbutton' ) ;
140-
140+ const currentTags = item . tagg || [ ] ;
141141
142142 addtagbutton . addEventListener ( 'click' , ( ) => {
143143 if ( isopen4 == false ) {
@@ -149,7 +149,7 @@ function refreshToDo() {
149149 isopen4 = false ;
150150 } ;
151151 } ) ;
152- item . tagg . forEach ( tag => {
152+ currentTags . forEach ( tag => {
153153
154154
155155 let tagInTodo = document . createElement ( 'p' ) ;
@@ -220,6 +220,9 @@ function refreshToDo() {
220220 tagInList . style . cursor = "pointer" ;
221221
222222 tagInList . addEventListener ( 'click' , ( ) => {
223+ if ( ! item . tagg ) {
224+ item . tagg = [ ] ;
225+ }
223226 if ( ! item . tagg . some ( t => t . name === tag . name ) ) {
224227
225228 item . tagg . push ( tag ) ;
You can’t perform that action at this time.
0 commit comments