Skip to content

Commit

Permalink
feat: animate account refresh (#471)
Browse files Browse the repository at this point in the history
Signed-off-by: Adam Setch <adam.setch@outlook.com>
  • Loading branch information
setchy authored Dec 28, 2024
1 parent baebbcf commit 916b922
Show file tree
Hide file tree
Showing 2 changed files with 43,596 additions and 14,617 deletions.
17 changes: 15 additions & 2 deletions src/renderer/routes/Accounts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,22 @@ export const AccountsRoute: FC = () => {
icon={RefreshIcon}
shape="circle"
appearance="subtle"
onClick={async () => {
onClick={async (e) => {
const button = e.currentTarget;
button.classList.add('animate-spin');

await refreshAccount(account);
navigate('/accounts', { replace: true });
navigate('/accounts', {
replace: true,
});

/**
* Typically the above refresh API call completes very quickly,
* so we add an brief artificial delay to allow the icon to spin a few times
*/
setTimeout(() => {
button.classList.remove('animate-spin');
}, 250);
}}
testId="account-refresh"
/>
Expand Down
Loading

0 comments on commit 916b922

Please sign in to comment.