|
|
@@ -292,18 +292,6 @@ export default class PageContainer extends Container {
|
|
|
await this.retrieveLikersAndSeenUsers();
|
|
|
}
|
|
|
|
|
|
- // this method is used only when like happend in normal page but not in search page.
|
|
|
- // noraml page view use the states based on pageContainer but search page holds its own state in SearchResultSunNavButton.
|
|
|
- async updateStateAfterLike() {
|
|
|
- const toggledIsLiked = !this.state.isLiked;
|
|
|
- await this.setState(state => ({
|
|
|
- isLiked: toggledIsLiked,
|
|
|
- sumOfLikers: toggledIsLiked ? state.sumOfLikers + 1 : state.sumOfLikers - 1,
|
|
|
- likerIds: toggledIsLiked
|
|
|
- ? [...this.state.likerIds, this.appContainer.currentUserId]
|
|
|
- : state.likerIds.filter(id => id !== this.appContainer.currentUserId),
|
|
|
- }));
|
|
|
- }
|
|
|
|
|
|
async retrieveLikersAndSeenUsers() {
|
|
|
const { users } = await this.appContainer.apiGet('/users.list', { user_ids: [...this.state.likerIds, ...this.state.seenUserIds].join(',') });
|