mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-10-01 01:36:12 -04:00
Fix scrolling issue on refetch.
This commit is contained in:
parent
abe31e9f17
commit
da1d7178a7
@ -174,6 +174,7 @@ export class Communities extends Component<any, CommunitiesState> {
|
||||
this.state.communities = res.communities;
|
||||
this.state.communities.sort((a, b) => b.number_of_subscribers - a.number_of_subscribers);
|
||||
this.state.loading = false;
|
||||
window.scrollTo(0,0);
|
||||
this.setState(this.state);
|
||||
} else if (op == UserOperation.FollowCommunity) {
|
||||
let res: CommunityResponse = msg;
|
||||
|
@ -215,6 +215,7 @@ export class Community extends Component<any, State> {
|
||||
let res: GetPostsResponse = msg;
|
||||
this.state.posts = res.posts;
|
||||
this.state.loading = false;
|
||||
window.scrollTo(0,0);
|
||||
this.setState(this.state);
|
||||
} else if (op == UserOperation.CreatePostLike) {
|
||||
let res: CreatePostLikeResponse = msg;
|
||||
|
@ -170,6 +170,7 @@ export class Inbox extends Component<any, InboxState> {
|
||||
let res: GetRepliesResponse = msg;
|
||||
this.state.replies = res.replies;
|
||||
this.sendRepliesCount();
|
||||
window.scrollTo(0,0);
|
||||
this.setState(this.state);
|
||||
} else if (op == UserOperation.EditComment) {
|
||||
let res: CommentResponse = msg;
|
||||
|
@ -383,6 +383,7 @@ export class Main extends Component<any, MainState> {
|
||||
let res: GetPostsResponse = msg;
|
||||
this.state.posts = res.posts;
|
||||
this.state.loading = false;
|
||||
window.scrollTo(0,0);
|
||||
this.setState(this.state);
|
||||
} else if (op == UserOperation.CreatePostLike) {
|
||||
let res: CreatePostLikeResponse = msg;
|
||||
|
@ -228,6 +228,7 @@ export class Modlog extends Component<any, ModlogState> {
|
||||
} else if (op == UserOperation.GetModlog) {
|
||||
let res: GetModlogResponse = msg;
|
||||
this.state.loading = false;
|
||||
window.scrollTo(0,0);
|
||||
this.setCombined(res);
|
||||
}
|
||||
}
|
||||
|
@ -251,6 +251,7 @@ export class Search extends Component<any, SearchState> {
|
||||
this.state.searchResponse = res;
|
||||
this.state.loading = false;
|
||||
document.title = `Search - ${this.state.q} - Lemmy`;
|
||||
window.scrollTo(0,0);
|
||||
this.setState(this.state);
|
||||
|
||||
}
|
||||
|
@ -342,6 +342,7 @@ export class User extends Component<any, UserState> {
|
||||
this.state.posts = res.posts;
|
||||
this.state.loading = false;
|
||||
document.title = `/u/${this.state.user.name} - Lemmy`;
|
||||
window.scrollTo(0,0);
|
||||
this.setState(this.state);
|
||||
} else if (op == UserOperation.EditComment) {
|
||||
let res: CommentResponse = msg;
|
||||
|
Loading…
Reference in New Issue
Block a user