Remove remaining frontend console logs for production
- Remove HTML loading and WASM initialization logs - Clean up service worker registration/activation logs - Remove alarm system initialization messages - Remove notification permission logging - Keep essential error logging for troubleshooting - Clean production console output 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -14,9 +14,8 @@
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<script>
|
<script>
|
||||||
console.log("HTML fully loaded, waiting for WASM...");
|
|
||||||
window.addEventListener('TrunkApplicationStarted', () => {
|
window.addEventListener('TrunkApplicationStarted', () => {
|
||||||
console.log("Trunk application started successfully!");
|
// Application loaded successfully
|
||||||
});
|
});
|
||||||
|
|
||||||
// Register service worker for alarm background processing
|
// Register service worker for alarm background processing
|
||||||
@@ -24,7 +23,7 @@
|
|||||||
window.addEventListener('load', () => {
|
window.addEventListener('load', () => {
|
||||||
navigator.serviceWorker.register('/service-worker.js')
|
navigator.serviceWorker.register('/service-worker.js')
|
||||||
.then((registration) => {
|
.then((registration) => {
|
||||||
console.log('SW registered: ', registration);
|
// Service worker registered successfully
|
||||||
})
|
})
|
||||||
.catch((registrationError) => {
|
.catch((registrationError) => {
|
||||||
console.log('SW registration failed: ', registrationError);
|
console.log('SW registration failed: ', registrationError);
|
||||||
|
|||||||
@@ -7,13 +7,11 @@ const STORAGE_KEY = 'calendar_alarms';
|
|||||||
|
|
||||||
// Install event
|
// Install event
|
||||||
self.addEventListener('install', event => {
|
self.addEventListener('install', event => {
|
||||||
console.log(`Service Worker ${SW_VERSION} installing...`);
|
|
||||||
self.skipWaiting(); // Activate immediately
|
self.skipWaiting(); // Activate immediately
|
||||||
});
|
});
|
||||||
|
|
||||||
// Activate event
|
// Activate event
|
||||||
self.addEventListener('activate', event => {
|
self.addEventListener('activate', event => {
|
||||||
console.log(`Service Worker ${SW_VERSION} activated`);
|
|
||||||
event.waitUntil(self.clients.claim()); // Take control immediately
|
event.waitUntil(self.clients.claim()); // Take control immediately
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -52,7 +50,6 @@ function handleCheckAlarms(event, data) {
|
|||||||
data: dueAlarms
|
data: dueAlarms
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log(`Checked ${allAlarms.length} alarms, found ${dueAlarms.length} due`);
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error checking alarms:', error);
|
console.error('Error checking alarms:', error);
|
||||||
event.ports[0].postMessage({
|
event.ports[0].postMessage({
|
||||||
@@ -119,7 +116,6 @@ setInterval(async () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log('Requested alarm check from main app');
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Background alarm check failed:', error);
|
console.error('Background alarm check failed:', error);
|
||||||
}
|
}
|
||||||
@@ -152,5 +148,3 @@ self.addEventListener('notificationclick', event => {
|
|||||||
})
|
})
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log(`Calendar Alarms Service Worker ${SW_VERSION} loaded`);
|
|
||||||
@@ -208,7 +208,6 @@ pub fn App() -> Html {
|
|||||||
|
|
||||||
use_effect_with((*auth_token).clone(), move |token| {
|
use_effect_with((*auth_token).clone(), move |token| {
|
||||||
if token.is_some() && !*alarm_storage_initialized {
|
if token.is_some() && !*alarm_storage_initialized {
|
||||||
web_sys::console::log_1(&"🔔 Initializing alarm system...".into());
|
|
||||||
|
|
||||||
let alarm_storage = alarm_storage.clone();
|
let alarm_storage = alarm_storage.clone();
|
||||||
let alarm_scheduler = alarm_scheduler.clone();
|
let alarm_scheduler = alarm_scheduler.clone();
|
||||||
@@ -226,10 +225,7 @@ pub fn App() -> Html {
|
|||||||
// Request notification permission
|
// Request notification permission
|
||||||
let scheduler = (*alarm_scheduler).clone();
|
let scheduler = (*alarm_scheduler).clone();
|
||||||
match scheduler.request_notification_permission().await {
|
match scheduler.request_notification_permission().await {
|
||||||
Ok(permission) => {
|
Ok(_permission) => {
|
||||||
web_sys::console::log_1(
|
|
||||||
&format!("🔔 Notification permission: {:?}", permission).into()
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
web_sys::console::warn_1(
|
web_sys::console::warn_1(
|
||||||
@@ -261,7 +257,6 @@ pub fn App() -> Html {
|
|||||||
|
|
||||||
alarm_check_interval.set(Some(interval));
|
alarm_check_interval.set(Some(interval));
|
||||||
|
|
||||||
web_sys::console::log_1(&"✅ Alarm system initialized successfully".into());
|
|
||||||
}
|
}
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
web_sys::console::error_1(
|
web_sys::console::error_1(
|
||||||
@@ -274,7 +269,6 @@ pub fn App() -> Html {
|
|||||||
// Clean up alarm system on logout
|
// Clean up alarm system on logout
|
||||||
alarm_check_interval.set(None); // This will drop and cancel the interval
|
alarm_check_interval.set(None); // This will drop and cancel the interval
|
||||||
alarm_storage_initialized.set(false);
|
alarm_storage_initialized.set(false);
|
||||||
web_sys::console::log_1(&"🔔 Alarm system cleaned up".into());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|| ()
|
|| ()
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ impl AlarmStorage {
|
|||||||
|
|
||||||
/// Initialize the storage (no-op for localStorage)
|
/// Initialize the storage (no-op for localStorage)
|
||||||
pub async fn init(&mut self) -> Result<(), wasm_bindgen::JsValue> {
|
pub async fn init(&mut self) -> Result<(), wasm_bindgen::JsValue> {
|
||||||
web_sys::console::log_1(&"AlarmStorage initialized with localStorage".into());
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user