use fqn for local account instead of building manually

This commit is contained in:
ari melody 2025-07-13 19:04:50 +01:00
parent b74b19cc73
commit b170a532f6
Signed by: ari
GPG key ID: CF99829C92678188
4 changed files with 5 additions and 3 deletions

View file

@ -31,6 +31,8 @@ export function parseAccount(data) {
else else
account.host = get(server).host; account.host = get(server).host;
account.fqn = data.fqn || account.username + account.host;
account.mention = "@" + account.username; account.mention = "@" + account.username;
if (account.host != get(server).host) if (account.host != get(server).host)
account.mention += "@" + account.host; account.mention += "@" + account.host;

View file

@ -175,7 +175,7 @@
<div class="account-name" aria-hidden="true"> <div class="account-name" aria-hidden="true">
<a href={$account.url} class="nickname" title={$account.nickname}>{@html $account.rich_name}</a> <a href={$account.url} class="nickname" title={$account.nickname}>{@html $account.rich_name}</a>
<span class="username" title={`@${$account.username}@${$account.host}`}> <span class="username" title={`@${$account.username}@${$account.host}`}>
{`@${$account.username}@${$account.host}`} {$account.fqn}
</span> </span>
</div> </div>
</div> </div>

View file

@ -28,7 +28,7 @@
if (!data) return; if (!data) return;
account.set(parseAccount(data)); account.set(parseAccount(data));
console.log(`Logged in as @${$account.username}@${$account.host}`); console.log(`Logged in as ${$account.fqn}`);
// spin up async task to fetch notifications // spin up async task to fetch notifications
const notif_data = await api.getNotifications( const notif_data = await api.getNotifications(

View file

@ -30,7 +30,7 @@
if (!data) return goto("/"); if (!data) return goto("/");
account.set(parseAccount(data)); account.set(parseAccount(data));
console.log(`Logged in as @${get(account).username}@${get(account).host}`); console.log(`Logged in as ${get(account).fqn}`);
// spin up async task to fetch notifications // spin up async task to fetch notifications
return api.getNotifications( return api.getNotifications(