|
@@ -126,7 +126,6 @@ export default class PageContainer extends Container {
|
|
|
// as it is stored in a separate collection to like and seen user
|
|
// as it is stored in a separate collection to like and seen user
|
|
|
// data so it has a separate api endpoint.
|
|
// data so it has a separate api endpoint.
|
|
|
this.initialPageLoad();
|
|
this.initialPageLoad();
|
|
|
- this.retrieveBookmarkInfo();
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
this.setTocHtml = this.setTocHtml.bind(this);
|
|
this.setTocHtml = this.setTocHtml.bind(this);
|
|
@@ -314,20 +313,6 @@ export default class PageContainer extends Container {
|
|
|
this.checkAndUpdateImageUrlCached(users);
|
|
this.checkAndUpdateImageUrlCached(users);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- async retrieveBookmarkInfo() {
|
|
|
|
|
- const response = await this.appContainer.apiv3Get('/bookmarks/info', { pageId: this.state.pageId });
|
|
|
|
|
- this.setState({
|
|
|
|
|
- sumOfBookmarks: response.data.sumOfBookmarks,
|
|
|
|
|
- isBookmarked: response.data.isBookmarked,
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- async toggleBookmark() {
|
|
|
|
|
- const bool = !this.state.isBookmarked;
|
|
|
|
|
- await this.appContainer.apiv3Put('/bookmarks', { pageId: this.state.pageId, bool });
|
|
|
|
|
- return this.retrieveBookmarkInfo();
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
async checkAndUpdateImageUrlCached(users) {
|
|
async checkAndUpdateImageUrlCached(users) {
|
|
|
const noImageCacheUsers = users.filter((user) => { return user.imageUrlCached == null });
|
|
const noImageCacheUsers = users.filter((user) => { return user.imageUrlCached == null });
|
|
|
if (noImageCacheUsers.length === 0) {
|
|
if (noImageCacheUsers.length === 0) {
|