enhance: shareページでより多くの情報を渡せるように (#7606)
* shareでより多くの情報を渡せるように * from chat ui post-form, remove instant and add share * fix await eating array, make document * add changelog * https://github.com/misskey-dev/misskey/pull/7606/files/3581bf9a060742dc59bf7fb8ea7316809cc60522#r692265037 * reply, renoteにも型定義 * 🎨 * 閉じなければ100ms後タイムラインに
This commit is contained in:
parent
202cb38c40
commit
ea8e6d88ab
6 changed files with 233 additions and 35 deletions
|
@ -1,13 +1,10 @@
|
|||
export type Acct = {
|
||||
username: string;
|
||||
host: string | null;
|
||||
};
|
||||
import * as Misskey from 'misskey-js';
|
||||
|
||||
export const getAcct = (user: Acct) => {
|
||||
export const getAcct = (user: Misskey.Acct) => {
|
||||
return user.host == null ? user.username : `${user.username}@${user.host}`;
|
||||
};
|
||||
|
||||
export const parseAcct = (acct: string): Acct => {
|
||||
export const parseAcct = (acct: string): Misskey.Acct => {
|
||||
if (acct.startsWith('@')) acct = acct.substr(1);
|
||||
const split = acct.split('@', 2);
|
||||
return { username: split[0], host: split[1] || null };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue