Skip to content

Commit 9441968

Browse files
committed
feat: animate account refresh button
Signed-off-by: Adam Setch <[email protected]>
1 parent 5c3f303 commit 9441968

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/renderer/routes/Accounts.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,17 @@ export const AccountsRoute: FC = () => {
153153
type="button"
154154
className={cn(BUTTON_CLASS_NAME, 'px-0')}
155155
title={`Refresh ${account.user.login}`}
156-
onClick={async () => {
156+
onClick={async (e) => {
157+
const button = e.currentTarget;
158+
button.classList.add('animate-spin');
159+
157160
await refreshAccount(account);
158161
navigate('/accounts', { replace: true });
162+
163+
// typically the above completes very quickly, so add an artificial delay to allow the spinner to do a few loops
164+
setTimeout(() => {
165+
button.classList.remove('animate-spin');
166+
}, 500);
159167
}}
160168
>
161169
<SyncIcon

0 commit comments

Comments
 (0)