File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1818 "default" : " ./dist/index.js"
1919 },
2020 "default" : " ./dist/index.js"
21- },
22- "./dist/styles.css" : " ./dist/styles.css"
21+ }
2322 },
2423 "main" : " ./dist/index.js" ,
2524 "types" : " ./dist/index.d.ts" ,
Original file line number Diff line number Diff line change @@ -139,11 +139,15 @@ const createToast = (options: InternalSileoOptions) => {
139139
140140 const prev = merged . id
141141 ? live . find ( ( t ) => t . id === merged . id )
142- : live [ live . length - 1 ] ;
143- const id = merged . id ?? prev ?. id ?? generateId ( ) ;
142+ : undefined ;
143+ const id = merged . id ?? generateId ( ) ;
144144 const item = buildSileoItem ( merged , id , prev ?. position ) ;
145145
146- store . update ( ( ) => [ item ] ) ;
146+ if ( prev ) {
147+ store . update ( ( p ) => p . map ( ( t ) => ( t . id === id ? item : t ) ) ) ;
148+ } else {
149+ store . update ( ( p ) => [ ...p , item ] ) ;
150+ }
147151 return { id, duration : merged . duration ?? DEFAULT_DURATION } ;
148152} ;
149153
You can’t perform that action at this time.
0 commit comments