summaryrefslogtreecommitdiffstats
path: root/ui/src/components
diff options
context:
space:
mode:
authorDessalines <tyhou13@gmx.com>2019-05-02 15:16:38 -0700
committerDessalines <tyhou13@gmx.com>2019-05-02 15:16:38 -0700
commit9903e3d508537e6912e38f61739971af1949f25e (patch)
tree71f742acbbe21d7df2c3e14f23c829adbf4b5987 /ui/src/components
parent820af563879fbf945092d2230f1e2fde0c860ca0 (diff)
Fix scrolling issue on refetch.
Diffstat (limited to 'ui/src/components')
-rw-r--r--ui/src/components/communities.tsx1
-rw-r--r--ui/src/components/community.tsx1
-rw-r--r--ui/src/components/inbox.tsx1
-rw-r--r--ui/src/components/main.tsx1
-rw-r--r--ui/src/components/modlog.tsx1
-rw-r--r--ui/src/components/search.tsx1
-rw-r--r--ui/src/components/user.tsx1
7 files changed, 7 insertions, 0 deletions
diff --git a/ui/src/components/communities.tsx b/ui/src/components/communities.tsx
index 190f8e3d..96864e9a 100644
--- a/ui/src/components/communities.tsx
+++ b/ui/src/components/communities.tsx
@@ -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;
diff --git a/ui/src/components/community.tsx b/ui/src/components/community.tsx
index 93cdbd92..28841a2e 100644
--- a/ui/src/components/community.tsx
+++ b/ui/src/components/community.tsx
@@ -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;
diff --git a/ui/src/components/inbox.tsx b/ui/src/components/inbox.tsx
index 659a4a20..69ddc44b 100644
--- a/ui/src/components/inbox.tsx
+++ b/ui/src/components/inbox.tsx
@@ -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;
diff --git a/ui/src/components/main.tsx b/ui/src/components/main.tsx
index cd679ecb..1ec016ea 100644
--- a/ui/src/components/main.tsx
+++ b/ui/src/components/main.tsx
@@ -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;
diff --git a/ui/src/components/modlog.tsx b/ui/src/components/modlog.tsx
index 853bdd20..894887ae 100644
--- a/ui/src/components/modlog.tsx
+++ b/ui/src/components/modlog.tsx
@@ -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);
}
}
diff --git a/ui/src/components/search.tsx b/ui/src/components/search.tsx
index f066f6ed..7c72939a 100644
--- a/ui/src/components/search.tsx
+++ b/ui/src/components/search.tsx
@@ -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);
}
diff --git a/ui/src/components/user.tsx b/ui/src/components/user.tsx
index 92ad5335..4cd88abc 100644
--- a/ui/src/components/user.tsx
+++ b/ui/src/components/user.tsx
@@ -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;