Skip to content

Commit 1254b97

Browse files
authored
Merge pull request #115 from BuildFire/fix/re-render-images
fix(widget): track posts - Ticket Number: PLUG-1744
2 parents a2a21b2 + 56a714a commit 1254b97

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

widget/app.service.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,8 @@
637637
if (error) return console.log(error);
638638

639639
if (data && data.result.length) {
640-
data.result.map(item => _this.items.push({...item.data, id: item.id}))
640+
const result = data.result.filter(item => !_this.items.find(_item => _item.id === item.id));
641+
result.map(item => _this.items.push({...item.data, id: item.id}))
641642
if (data.totalRecord > _this.items.length) {
642643
_this.showMorePosts = true;
643644
_this.page++;

widget/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102
<div ng-show="WidgetWall.SocialItems.items.length<=0 && WidgetWall.loadedPlugin && !WidgetWall.loading">
103103
<div class="empty_state"></div>
104104
</div>
105-
<div class="social-item" ng-repeat="post in WidgetWall.SocialItems.items">
105+
<div class="social-item" ng-repeat="post in WidgetWall.SocialItems.items track by post.id">
106106

107107
<div class="head">
108108
<div ng-class="{'social-profile-user-photo': WidgetWall.SocialItems.userDetails.userId == post.userId}"

0 commit comments

Comments
 (0)