diff --git a/src/web/app/mobile/views/components/users-list.vue b/src/web/app/mobile/views/components/users-list.vue
index 24c96aec79..d6c6261354 100644
--- a/src/web/app/mobile/views/components/users-list.vue
+++ b/src/web/app/mobile/views/components/users-list.vue
@@ -32,13 +32,18 @@ export default Vue.extend({
next: null
};
},
+ watch: {
+ mode() {
+ this._fetch();
+ }
+ },
mounted() {
this._fetch(() => {
this.$emit('loaded');
});
},
methods: {
- _fetch(cb) {
+ _fetch(cb?) {
this.fetching = true;
this.fetch(this.mode == 'iknow', this.limit, null, obj => {
this.users = obj.users;
diff --git a/src/web/app/mobile/views/pages/followers.vue b/src/web/app/mobile/views/pages/followers.vue
index 2f102bd68f..c2b6b90e29 100644
--- a/src/web/app/mobile/views/pages/followers.vue
+++ b/src/web/app/mobile/views/pages/followers.vue
@@ -1,10 +1,18 @@
-
+
{{ '%i18n:mobile.tags.mk-user-followers-page.followers-of%'.replace('{}', user.name) }}
-
-
+
+
+ %i18n:mobile.tags.mk-user-followers.no-users%
+
@@ -13,29 +21,45 @@ import Vue from 'vue';
import Progress from '../../../common/scripts/loading';
export default Vue.extend({
- props: ['username'],
data() {
return {
fetching: true,
user: null
};
},
+ watch: {
+ $route: 'fetch'
+ },
+ created() {
+ this.fetch();
+ },
mounted() {
- Progress.start();
-
- (this as any).api('users/show', {
- username: this.username
- }).then(user => {
- this.user = user;
- this.fetching = false;
-
- document.title = '%i18n:mobile.tags.mk-user-followers-page.followers-of%'.replace('{}', user.name) + ' | Misskey';
- document.documentElement.style.background = '#313a42';
- });
+ document.documentElement.style.background = '#313a42';
},
methods: {
+ fetch() {
+ Progress.start();
+ this.fetching = true;
+
+ (this as any).api('users/show', {
+ username: this.$route.params.user
+ }).then(user => {
+ this.user = user;
+ this.fetching = false;
+
+ document.title = '%i18n:mobile.tags.mk-user-followers-page.followers-of%'.replace('{}', user.name) + ' | Misskey';
+ });
+ },
onLoaded() {
Progress.done();
+ },
+ fetchUsers(iknow, limit, cursor, cb) {
+ (this as any).api('users/followers', {
+ user_id: this.user.id,
+ iknow: iknow,
+ limit: limit,
+ cursor: cursor ? cursor : undefined
+ }).then(cb);
}
}
});
diff --git a/src/web/app/mobile/views/pages/following.vue b/src/web/app/mobile/views/pages/following.vue
index 20f085a9f1..6365d3b370 100644
--- a/src/web/app/mobile/views/pages/following.vue
+++ b/src/web/app/mobile/views/pages/following.vue
@@ -1,10 +1,18 @@
-
+
- {{ '%i18n:mobile.tags.mk-user-following-page.following-of'.replace('{}', user.name) }}
-
-
+ {{ '%i18n:mobile.tags.mk-user-following-page.following-of%'.replace('{}', user.name) }}
+
+
+ %i18n:mobile.tags.mk-user-following.no-users%
+
@@ -13,29 +21,45 @@ import Vue from 'vue';
import Progress from '../../../common/scripts/loading';
export default Vue.extend({
- props: ['username'],
data() {
return {
fetching: true,
user: null
};
},
+ watch: {
+ $route: 'fetch'
+ },
+ created() {
+ this.fetch();
+ },
mounted() {
- Progress.start();
-
- (this as any).api('users/show', {
- username: this.username
- }).then(user => {
- this.user = user;
- this.fetching = false;
-
- document.title = '%i18n:mobile.tags.mk-user-followers-page.followers-of%'.replace('{}', user.name) + ' | Misskey';
- document.documentElement.style.background = '#313a42';
- });
+ document.documentElement.style.background = '#313a42';
},
methods: {
+ fetch() {
+ Progress.start();
+ this.fetching = true;
+
+ (this as any).api('users/show', {
+ username: this.$route.params.user
+ }).then(user => {
+ this.user = user;
+ this.fetching = false;
+
+ document.title = '%i18n:mobile.tags.mk-user-followers-page.followers-of%'.replace('{}', user.name) + ' | Misskey';
+ });
+ },
onLoaded() {
Progress.done();
+ },
+ fetchUsers(iknow, limit, cursor, cb) {
+ (this as any).api('users/following', {
+ user_id: this.user.id,
+ iknow: iknow,
+ limit: limit,
+ cursor: cursor ? cursor : undefined
+ }).then(cb);
}
}
});