pl-fe: improve mute expiration handling

Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>
This commit is contained in:
nicole mikołajczyk
2025-10-27 12:01:06 +01:00
parent be918fbb80
commit d94c19fd9d
5 changed files with 17 additions and 22 deletions

View File

@ -1,17 +1,5 @@
import type { Account as BaseAccount } from 'pl-api';
import type { Account } from 'pl-api';
const normalizeAccount = (account: BaseAccount) => {
const missingAvatar: string = require('pl-fe/assets/images/avatar-missing.png');
const missingHeader: string = require('pl-fe/assets/images/header-missing.png');
return {
mute_expires_at: null,
...account,
avatar: account.avatar || account.avatar_static || missingAvatar,
header: account.header || account.header_static || missingHeader,
};
};
type Account = ReturnType<typeof normalizeAccount>;
const normalizeAccount = (account: Account) => account;
export { normalizeAccount, type Account };