@@ -1487,6 +1487,7 @@ const Page = ( function($, backend_url) {
14871487
14881488 /*TODO check vice versa case*/
14891489 $widgetActivity . find ( '.activity-empty-today' ) . remove ( ) ;
1490+ $widgetActivity . find ( '.activity-divider.hidden:first' ) . removeClass ( 'hidden' ) ;
14901491
14911492 that . storage . isActivityFilterLocked = false ;
14921493 } ) ;
@@ -1608,6 +1609,17 @@ const Page = ( function($, backend_url) {
16081609
16091610 /*TODO check vice versa case*/
16101611 $widgetActivity . find ( '.activity-empty-today' ) . remove ( ) ;
1612+
1613+ const $activity_divider = $widgetActivity . find ( '.activity-divider' ) ;
1614+ let uniqueTexts = [ ] ;
1615+ $activity_divider . each ( function ( ) {
1616+ const text = $ ( this ) . text ( ) ;
1617+ if ( $ . inArray ( text , uniqueTexts ) === - 1 ) {
1618+ uniqueTexts . push ( text ) ;
1619+ } else {
1620+ $ ( this ) . remove ( ) ;
1621+ }
1622+ } ) ;
16111623 } ) ;
16121624 }
16131625 }
@@ -1637,7 +1649,23 @@ const Page = ( function($, backend_url) {
16371649 // Render
16381650 $widgetActivity . find ( ".empty-activity-text" ) . remove ( ) ;
16391651 $widgetActivity . find ( ".activity-item.activity-empty-today" ) . remove ( ) ;
1640- $wrapper . prepend ( response ) ;
1652+ const $today_divider = $widgetActivity . find ( '.activity-divider.today' ) ;
1653+ const $activity_divider = $widgetActivity . find ( '.activity-divider' ) ;
1654+ if ( $today_divider . length ) {
1655+ $today_divider . after ( response )
1656+ } else {
1657+ $wrapper . prepend ( response ) ;
1658+ }
1659+
1660+ let uniqueTexts = [ ] ;
1661+ $activity_divider . each ( function ( ) {
1662+ const text = $ ( this ) . text ( ) ;
1663+ if ( $ . inArray ( text , uniqueTexts ) === - 1 ) {
1664+ uniqueTexts . push ( text ) ;
1665+ } else {
1666+ $ ( this ) . remove ( ) ;
1667+ }
1668+ } ) ;
16411669 }
16421670
16431671 that . storage . isTopLazyLoadLocked = false ;
0 commit comments