Fix frontend loading

This commit is contained in:
riku6460 2023-09-26 06:04:48 +09:00
parent 4d9a694d8d
commit 8291dfa045
No known key found for this signature in database
GPG Key ID: 27414FA27DB94CF6
1 changed files with 4 additions and 3 deletions

View File

@ -4,16 +4,17 @@
*/
import * as Misskey from 'misskey-js';
import * as Acct from 'misskey-js/src/acct.js';
import { url } from '@/config.js';
export const acct = (user: misskey.Acct) => {
return Misskey.acct.toString(user);
export const acct = (user: Misskey.Acct) => {
return Acct.toString(user);
};
export const userName = (user: Misskey.entities.User) => {
return user.name || user.username;
};
export const userPage = (user: misskey.Acct, path?, absolute = false) => {
export const userPage = (user: Misskey.Acct, path?, absolute = false) => {
return `${absolute ? url : ''}/@${acct(user)}${(path ? `/${path}` : '')}`;
};