Skip to content

Commit 48db6f9

Browse files
authored
feat: animate account refresh button (#1689)
* feat: animate account refresh button Signed-off-by: Adam Setch <[email protected]> * feat: animate account refresh button Signed-off-by: Adam Setch <[email protected]> * feat: animate account refresh button Signed-off-by: Adam Setch <[email protected]> * feat: animate account refresh button Signed-off-by: Adam Setch <[email protected]> * feat: animate account refresh button Signed-off-by: Adam Setch <[email protected]> --------- Signed-off-by: Adam Setch <[email protected]>
1 parent 2404184 commit 48db6f9

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/renderer/routes/Accounts.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,20 @@ 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+
/**
164+
* Typically the above refresh API call completes very quickly,
165+
* so we add an brief artificial delay to allow the icon to spin a few times
166+
*/
167+
setTimeout(() => {
168+
button.classList.remove('animate-spin');
169+
}, 500);
159170
}}
160171
>
161172
<SyncIcon

0 commit comments

Comments
 (0)