quantum-ai-v3/static/js/wallet-test.js
Claude a46b07e371 🎯 Fix webhook agents by removing custom JavaScript conflicts
- Remove job-posting-generator.js and social-ads.js custom files
- All webhook agents now use unified agents-core.js system
- Consistent behavior: Form → Django API → N8N → Results
- Fixes job posting and social ads result display issues
- Simplifies maintenance with single JavaScript codebase
- Aligns with file-based agent creation goal (JSON only)

 All 4 webhook agents now work consistently
 All 5 direct access agents use generic handlers
 Agent creation: Just add JSON file, no custom code needed

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-15 09:35:43 +05:30

43 lines
1.4 KiB
JavaScript

/**
* Quick wallet balance update test
* Run this in browser console to test wallet balance updates
*/
function testWalletUpdate() {
console.log('Testing wallet balance update...');
// Get current balance from data attribute
const currentBalance = parseFloat(document.body.getAttribute('data-user-balance') || '0');
console.log('Current balance from data attribute:', currentBalance);
// Get header balance element
const headerBalance = document.querySelector('[data-wallet-balance]');
console.log('Header balance element found:', !!headerBalance);
if (headerBalance) {
console.log('Current header text:', headerBalance.textContent);
}
// Test updating to a new balance
const testBalance = currentBalance - 6.0;
console.log('Testing update to:', testBalance);
if (window.WorkflowsCore) {
WorkflowsCore.updateWalletBalance(testBalance);
console.log('✅ WorkflowsCore.updateWalletBalance() called');
// Check if it worked
if (headerBalance) {
console.log('New header text:', headerBalance.textContent);
}
console.log('New data attribute:', document.body.getAttribute('data-user-balance'));
} else {
console.log('❌ WorkflowsCore not available');
}
}
// Auto-run test
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', testWalletUpdate);
} else {
testWalletUpdate();
}