mirror of
https://github.com/kokonect-link/cherrypick
synced 2024-12-01 00:08:31 +09:00
parent
88ec15d4c7
commit
570931cff8
@ -72,11 +72,40 @@ export default Vue.extend({
|
||||
const acct = new URL(location.href).searchParams.get('acct');
|
||||
this.fetching = true;
|
||||
Progress.start();
|
||||
this.$root.api('users/show', parseAcct(acct)).then(user => {
|
||||
this.user = user;
|
||||
if (acct.match(/^https?:/)) {
|
||||
this.$root.api('ap/show', {
|
||||
uri: acct
|
||||
}).then((res: { type: string, object: any }) => {
|
||||
if (res.type !== 'User') {
|
||||
this.$root.dialog({
|
||||
type: 'error',
|
||||
text: 'acct is not an user'
|
||||
});
|
||||
} else {
|
||||
this.user = res.object;
|
||||
}
|
||||
}).catch((e: any) => {
|
||||
this.$root.dialog({
|
||||
type: 'error',
|
||||
text: e.message
|
||||
});
|
||||
}).finally(() => {
|
||||
this.fetching = false;
|
||||
Progress.done();
|
||||
});
|
||||
} else {
|
||||
this.$root.api('users/show', parseAcct(acct)).then((user: any) => {
|
||||
this.user = user;
|
||||
}).catch((e: any) => {
|
||||
this.$root.dialog({
|
||||
type: 'error',
|
||||
text: e.message
|
||||
});
|
||||
}).finally(() => {
|
||||
this.fetching = false;
|
||||
Progress.done();
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
async onClick() {
|
||||
|
Loading…
Reference in New Issue
Block a user