mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-06-13 12:14:21 +02:00
Refactor & Clean up
This commit is contained in:
@@ -25,7 +25,7 @@ export default Vue.extend({
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
(this as any).api('users/followers', {
|
||||
this.$root.api('users/followers', {
|
||||
userId: this.user.id,
|
||||
iknow: true,
|
||||
limit: 16
|
||||
|
||||
@@ -30,7 +30,7 @@ export default Vue.extend({
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
(this as any).api('users/get_frequently_replied_users', {
|
||||
this.$root.api('users/get_frequently_replied_users', {
|
||||
userId: this.user.id,
|
||||
limit: 4
|
||||
}).then(docs => {
|
||||
|
||||
@@ -24,7 +24,7 @@ export default Vue.extend({
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
(this as any).api('users/notes', {
|
||||
this.$root.api('users/notes', {
|
||||
userId: this.user.id,
|
||||
withFiles: true,
|
||||
limit: 9
|
||||
|
||||
@@ -33,7 +33,7 @@ export default Vue.extend({
|
||||
|
||||
methods: {
|
||||
stalk() {
|
||||
(this as any).api('following/stalk', {
|
||||
this.$root.api('following/stalk', {
|
||||
userId: this.user.id
|
||||
}).then(() => {
|
||||
this.user.isStalking = true;
|
||||
@@ -43,7 +43,7 @@ export default Vue.extend({
|
||||
},
|
||||
|
||||
unstalk() {
|
||||
(this as any).api('following/unstalk', {
|
||||
this.$root.api('following/unstalk', {
|
||||
userId: this.user.id
|
||||
}).then(() => {
|
||||
this.user.isStalking = false;
|
||||
@@ -53,7 +53,7 @@ export default Vue.extend({
|
||||
},
|
||||
|
||||
mute() {
|
||||
(this as any).api('mute/create', {
|
||||
this.$root.api('mute/create', {
|
||||
userId: this.user.id
|
||||
}).then(() => {
|
||||
this.user.isMuted = true;
|
||||
@@ -63,7 +63,7 @@ export default Vue.extend({
|
||||
},
|
||||
|
||||
unmute() {
|
||||
(this as any).api('mute/delete', {
|
||||
this.$root.api('mute/delete', {
|
||||
userId: this.user.id
|
||||
}).then(() => {
|
||||
this.user.isMuted = false;
|
||||
@@ -74,7 +74,7 @@ export default Vue.extend({
|
||||
|
||||
block() {
|
||||
if (!window.confirm(this.$t('block-confirm'))) return;
|
||||
(this as any).api('blocking/create', {
|
||||
this.$root.api('blocking/create', {
|
||||
userId: this.user.id
|
||||
}).then(() => {
|
||||
this.user.isBlocking = true;
|
||||
@@ -84,7 +84,7 @@ export default Vue.extend({
|
||||
},
|
||||
|
||||
unblock() {
|
||||
(this as any).api('blocking/delete', {
|
||||
this.$root.api('blocking/delete', {
|
||||
userId: this.user.id
|
||||
}).then(() => {
|
||||
this.user.isBlocking = false;
|
||||
@@ -94,10 +94,10 @@ export default Vue.extend({
|
||||
},
|
||||
|
||||
list() {
|
||||
const w = (this as any).os.new(MkUserListsWindow);
|
||||
const w = this.$root.new(MkUserListsWindow);
|
||||
w.$once('choosen', async list => {
|
||||
w.close();
|
||||
await (this as any).api('users/lists/push', {
|
||||
await this.$root.api('users/lists/push', {
|
||||
listId: list.id,
|
||||
userId: this.user.id
|
||||
});
|
||||
|
||||
@@ -60,7 +60,7 @@ export default Vue.extend({
|
||||
fetch(cb?) {
|
||||
this.fetching = true;
|
||||
(this.$refs.timeline as any).init(() => new Promise((res, rej) => {
|
||||
(this as any).api('users/notes', {
|
||||
this.$root.api('users/notes', {
|
||||
userId: this.user.id,
|
||||
limit: fetchLimit + 1,
|
||||
untilDate: this.date ? this.date.getTime() : undefined,
|
||||
@@ -81,7 +81,7 @@ export default Vue.extend({
|
||||
more() {
|
||||
this.moreFetching = true;
|
||||
|
||||
const promise = (this as any).api('users/notes', {
|
||||
const promise = this.$root.api('users/notes', {
|
||||
userId: this.user.id,
|
||||
limit: fetchLimit + 1,
|
||||
includeReplies: this.mode == 'with-replies',
|
||||
|
||||
@@ -68,7 +68,7 @@ export default Vue.extend({
|
||||
fetch() {
|
||||
this.fetching = true;
|
||||
Progress.start();
|
||||
(this as any).api('users/show', parseAcct(this.$route.params.user)).then(user => {
|
||||
this.$root.api('users/show', parseAcct(this.$route.params.user)).then(user => {
|
||||
this.user = user;
|
||||
this.fetching = false;
|
||||
Progress.done();
|
||||
|
||||
Reference in New Issue
Block a user