MOBILE-3205 forum: Save forum discussion sorting
parent
34ac2a93d8
commit
e1e2b83933
|
@ -131,13 +131,17 @@ export class AddonModForumDiscussionPage implements OnDestroy {
|
||||||
* View loaded.
|
* View loaded.
|
||||||
*/
|
*/
|
||||||
ionViewDidLoad(): void {
|
ionViewDidLoad(): void {
|
||||||
this.fetchPosts(true, false, true).then(() => {
|
this.sitesProvider.getCurrentSite().getLocalSiteConfig('AddonModForumDiscussionSort', this.sort).then((value) => {
|
||||||
if (this.postId) {
|
this.sort = value;
|
||||||
// Scroll to the post.
|
}).finally(() => {
|
||||||
setTimeout(() => {
|
this.fetchPosts(true, false, true).then(() => {
|
||||||
this.domUtils.scrollToElementBySelector(this.content, '#addon-mod_forum-post-' + this.postId);
|
if (this.postId) {
|
||||||
});
|
// Scroll to the post.
|
||||||
}
|
setTimeout(() => {
|
||||||
|
this.domUtils.scrollToElementBySelector(this.content, '#addon-mod_forum-post-' + this.postId);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -513,6 +517,7 @@ export class AddonModForumDiscussionPage implements OnDestroy {
|
||||||
changeSort(type: SortType): Promise<any> {
|
changeSort(type: SortType): Promise<any> {
|
||||||
this.discussionLoaded = false;
|
this.discussionLoaded = false;
|
||||||
this.sort = type;
|
this.sort = type;
|
||||||
|
this.sitesProvider.getCurrentSite().setLocalSiteConfig('AddonModForumDiscussionSort', this.sort);
|
||||||
this.domUtils.scrollToTop(this.content);
|
this.domUtils.scrollToTop(this.content);
|
||||||
|
|
||||||
return this.fetchPosts();
|
return this.fetchPosts();
|
||||||
|
|
Loading…
Reference in New Issue