From 9a49433a28f6a8b844c2740618d034fe17805398 Mon Sep 17 00:00:00 2001 From: Lucas 'Paperboy' Rose-Winters Date: Wed, 22 Oct 2025 10:34:31 +1100 Subject: [PATCH] fix: add spinner animation to mobile refresh FAB button The spinning animation when refreshing existed but only worked on the desktop button. Mobile FAB was never updated with the spinner. Changes: - Update both desktop and mobile buttons when refresh starts - Desktop shows: spinner + 'Updating...' text - Mobile FAB shows: spinner icon only (no text) - Both buttons restore properly when done Now mobile users see the spinner animation when tapping refresh! --- src/systems/generation/apiClient.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/systems/generation/apiClient.js b/src/systems/generation/apiClient.js index e30bec0..1f72fa3 100644 --- a/src/systems/generation/apiClient.js +++ b/src/systems/generation/apiClient.js @@ -97,11 +97,16 @@ export async function updateRPGData(renderUserStats, renderInfoBox, renderThough try { setIsGenerating(true); - // Update button to show "Updating..." state + // Update desktop button to show "Updating..." state const $updateBtn = $('#rpg-manual-update'); const originalHtml = $updateBtn.html(); $updateBtn.html(' Updating...').prop('disabled', true); + // Update mobile FAB to show spinner (icon only) + const $updateBtnMobile = $('#rpg-manual-update-mobile'); + const originalHtmlMobile = $updateBtnMobile.html(); + $updateBtnMobile.html('').prop('disabled', true); + // Save current preset name before switching (if we're going to switch) if (extensionSettings.useSeparatePreset) { originalPresetName = await getCurrentPresetName(); @@ -219,10 +224,14 @@ export async function updateRPGData(renderUserStats, renderInfoBox, renderThough setIsGenerating(false); - // Restore button to original state + // Restore desktop button to original state const $updateBtn = $('#rpg-manual-update'); $updateBtn.html(' Refresh RPG Info').prop('disabled', false); + // Restore mobile FAB to original state (icon only) + const $updateBtnMobile = $('#rpg-manual-update-mobile'); + $updateBtnMobile.html('').prop('disabled', false); + // Reset the flag after tracker generation completes // This ensures the flag persists through both main generation AND tracker generation // console.log('[RPG Companion] 🔄 Tracker generation complete - resetting lastActionWasSwipe to false');