Skip to content

Commit 8a97585

Browse files
committed
Add debugging logs to relay icon auto-update logic
- Add console logs to track when relay icon should be auto-updated - Debug why empty relayicon field is not triggering backend update - Logs will show settings state, expected icon URL, and update flow
1 parent d29740e commit 8a97585

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/components/settings/RelayInfoSettings.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,23 @@ const RelayInfoSettings: React.FC = () => {
2424
const currentOrigin = window.location.origin;
2525
const expectedDefaultIcon = `${currentOrigin}/logo-dark-192.png`;
2626

27+
console.log('RelayInfoSettings - Current settings:', settings);
28+
console.log('RelayInfoSettings - Expected default icon:', expectedDefaultIcon);
29+
console.log('RelayInfoSettings - Current relayicon:', settings.relayicon);
30+
2731
// Check if relay icon is empty and set default bee logo
2832
const updatedSettings = { ...settings };
2933
let shouldUpdateBackend = false;
3034

3135
if (!updatedSettings.relayicon || updatedSettings.relayicon.trim() === '') {
36+
console.log('RelayInfoSettings - Setting default icon for empty field');
3237
updatedSettings.relayicon = expectedDefaultIcon;
3338
shouldUpdateBackend = true;
3439
} else if (updatedSettings.relayicon.endsWith('/logo-dark-192.png')) {
3540
// Check if the domain has changed from what's stored
3641
const storedIcon = updatedSettings.relayicon;
3742
if (storedIcon !== expectedDefaultIcon) {
43+
console.log('RelayInfoSettings - Updating icon for domain change');
3844
updatedSettings.relayicon = expectedDefaultIcon;
3945
shouldUpdateBackend = true;
4046
}
@@ -44,9 +50,11 @@ const RelayInfoSettings: React.FC = () => {
4450

4551
// Automatically update backend if domain changed
4652
if (shouldUpdateBackend) {
53+
console.log('RelayInfoSettings - Updating backend with:', expectedDefaultIcon);
4754
updateSettings({ relayicon: expectedDefaultIcon });
4855
// Auto-save the change to persist it
4956
setTimeout(() => {
57+
console.log('RelayInfoSettings - Saving settings to backend');
5058
saveSettings();
5159
}, 100);
5260
}

0 commit comments

Comments
 (0)