修正
This commit is contained in:
parent
8a5daa866c
commit
57e1ddcd3f
2 changed files with 25 additions and 23 deletions
|
@ -33,7 +33,7 @@ html
|
||||||
script.
|
script.
|
||||||
const token = '#{token}';
|
const token = '#{token}';
|
||||||
const previousToken = localStorage.getItem('token');
|
const previousToken = localStorage.getItem('token');
|
||||||
const accounts = JSON.parse(localStorage.getItem('accounts') && '[]');
|
const accounts = JSON.parse(localStorage.getItem('accounts') || '[]');
|
||||||
if (previousToken && !accounts.includes(previousToken)) {
|
if (previousToken && !accounts.includes(previousToken)) {
|
||||||
accounts.push(previousToken);
|
accounts.push(previousToken);
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,8 +37,9 @@ export const AccountsPage: React.VFC = () => {
|
||||||
<p>@{data.username}@{data.host}</p>
|
<p>@{data.username}@{data.host}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<article>
|
<article className="card">
|
||||||
<h2>{t('_accounts.switchAccount')}</h2>
|
<div className="body">
|
||||||
|
<h1>{t('_accounts.switchAccount')}</h1>
|
||||||
<div className="menu large fluid mb-2">
|
<div className="menu large fluid mb-2">
|
||||||
{
|
{
|
||||||
accounts.length === accountTokens.length ? (
|
accounts.length === accountTokens.length ? (
|
||||||
|
@ -61,6 +62,7 @@ export const AccountsPage: React.VFC = () => {
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
<LoginForm />
|
<LoginForm />
|
||||||
|
</div>
|
||||||
</article>
|
</article>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue