| … | … | @@ -1398,8 +1398,8 @@ async function executeDeviceJoin() { |
| 1398 | 1398 | } |
| 1399 | 1399 | |
| 1400 | 1400 | async function forceSyncNow() { |
| 1401 | | showError('Feature coming soon: Manual sync trigger') |
| 1402 | | // In future, this would call the sync API |
| 1401 | // Trigger the sync button's functionality |
| 1402 | await syncTransactions() |
| 1403 | 1403 | } |
| 1404 | 1404 | |
| 1405 | 1405 | function verifyBackup() { |
| … | … | @@ -2114,11 +2114,18 @@ async function syncTransactions() { |
| 2114 | 2114 | |
| 2115 | 2115 | if (data.result.synced > 0) { |
| 2116 | 2116 | showSuccess(`✅ Synced ${data.result.synced} new transactions`) |
| 2117 | | // Reload transactions to show newly synced ones |
| 2118 | | await loadTransactions() |
| 2119 | 2117 | } else { |
| 2120 | | showSuccess('✅ Already up to date') |
| 2118 | showSuccess('✅ Transactions up to date') |
| 2119 | } |
| 2120 | |
| 2121 | // Always refresh balance and transactions after sync |
| 2122 | // Balance comes fresh from blockchain via RPC (Alchemy) |
| 2123 | if (selectedChain === 'ethereum') { |
| 2124 | await loadEthereumBalances() |
| 2125 | } else { |
| 2126 | await loadCurrentBalance() |
| 2121 | 2127 | } |
| 2128 | await loadTransactions() |
| 2122 | 2129 | |
| 2123 | 2130 | if (data.result.errors && data.result.errors.length > 0) { |
| 2124 | 2131 | console.warn('Sync warnings:', data.result.errors) |