mirror of
https://github.com/basicswap/basicswap.git
synced 2025-11-05 18:38:09 +01:00
ui: Main price chart fixes/updates.
This commit is contained in:
@@ -1027,6 +1027,7 @@ const app = {
|
||||
app.stopAutoRefresh();
|
||||
} else {
|
||||
app.startAutoRefresh();
|
||||
app.startSpinAnimation();
|
||||
}
|
||||
app.updateAutoRefreshButton();
|
||||
},
|
||||
@@ -1066,20 +1067,30 @@ const app = {
|
||||
if (app.isAutoRefreshEnabled) {
|
||||
button.classList.remove('text-gray-600', 'dark:text-gray-400');
|
||||
button.classList.add('text-green-500', 'dark:text-green-400');
|
||||
app.startSpinAnimation();
|
||||
} else {
|
||||
button.classList.remove('text-green-500', 'dark:text-green-400');
|
||||
button.classList.add('text-gray-600', 'dark:text-gray-400');
|
||||
app.stopSpinAnimation();
|
||||
}
|
||||
button.title = app.isAutoRefreshEnabled ? 'Disable Auto-Refresh' : 'Enable Auto-Refresh';
|
||||
}
|
||||
},
|
||||
|
||||
const svg = button.querySelector('svg');
|
||||
startSpinAnimation: () => {
|
||||
const svg = document.querySelector('#toggle-auto-refresh svg');
|
||||
if (svg) {
|
||||
if (app.isAutoRefreshEnabled) {
|
||||
svg.classList.add('animate-spin');
|
||||
} else {
|
||||
setTimeout(() => {
|
||||
svg.classList.remove('animate-spin');
|
||||
}, 2000); // Remove the animation after 2 seconds
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
stopSpinAnimation: () => {
|
||||
const svg = document.querySelector('#toggle-auto-refresh svg');
|
||||
if (svg) {
|
||||
svg.classList.remove('animate-spin');
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user