This commit is contained in:
syuilo 2018-09-10 03:02:06 +09:00
parent ba05f236bd
commit bc3a5f3512
No known key found for this signature in database
GPG key ID: BDC4C49D06AB9D69
2 changed files with 8 additions and 8 deletions

View file

@ -63,6 +63,7 @@ import MkVisibilityChooser from '../../../common/views/components/visibility-cho
import parse from '../../../../../mfm/parse'; import parse from '../../../../../mfm/parse';
import { host } from '../../../config'; import { host } from '../../../config';
import { erase } from '../../../../../prelude/array'; import { erase } from '../../../../../prelude/array';
import parseAcct from '../../../../../misc/acct/parse';
export default Vue.extend({ export default Vue.extend({
components: { components: {
@ -337,10 +338,9 @@ export default Vue.extend({
addVisibleUser() { addVisibleUser() {
(this as any).apis.input({ (this as any).apis.input({
title: '%i18n:@enter-username%' title: '%i18n:@enter-username%'
}).then(username => { }).then(acct => {
(this as any).api('users/show', { if (acct.startsWith('@')) acct = acct.substr(1);
username (this as any).api('users/show', parseAcct(acct)).then(user => {
}).then(user => {
this.visibleUsers.push(user); this.visibleUsers.push(user);
}); });
}); });

View file

@ -60,6 +60,7 @@ import getFace from '../../../common/scripts/get-face';
import parse from '../../../../../mfm/parse'; import parse from '../../../../../mfm/parse';
import { host } from '../../../config'; import { host } from '../../../config';
import { erase } from '../../../../../prelude/array'; import { erase } from '../../../../../prelude/array';
import parseAcct from '../../../../../misc/acct/parse';
export default Vue.extend({ export default Vue.extend({
components: { components: {
@ -253,10 +254,9 @@ export default Vue.extend({
addVisibleUser() { addVisibleUser() {
(this as any).apis.input({ (this as any).apis.input({
title: '%i18n:@username-prompt%' title: '%i18n:@username-prompt%'
}).then(username => { }).then(acct => {
(this as any).api('users/show', { if (acct.startsWith('@')) acct = acct.substr(1);
username (this as any).api('users/show', parseAcct(acct)).then(user => {
}).then(user => {
this.visibleUsers.push(user); this.visibleUsers.push(user);
}); });
}); });