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>
|
||||
<body>
|
||||
<script>
|
||||
console.log("HTML fully loaded, waiting for WASM...");
|
||||
window.addEventListener('TrunkApplicationStarted', () => {
|
||||
console.log("Trunk application started successfully!");
|
||||
// Application loaded successfully
|
||||
});
|
||||
|
||||
// Register service worker for alarm background processing
|
||||
@@ -24,7 +23,7 @@
|
||||
window.addEventListener('load', () => {
|
||||
navigator.serviceWorker.register('/service-worker.js')
|
||||
.then((registration) => {
|
||||
console.log('SW registered: ', registration);
|
||||
// Service worker registered successfully
|
||||
})
|
||||
.catch((registrationError) => {
|
||||
console.log('SW registration failed: ', registrationError);
|
||||
|
||||
@@ -7,13 +7,11 @@ const STORAGE_KEY = 'calendar_alarms';
|
||||
|
||||
// Install event
|
||||
self.addEventListener('install', event => {
|
||||
console.log(`Service Worker ${SW_VERSION} installing...`);
|
||||
self.skipWaiting(); // Activate immediately
|
||||
});
|
||||
|
||||
// Activate event
|
||||
self.addEventListener('activate', event => {
|
||||
console.log(`Service Worker ${SW_VERSION} activated`);
|
||||
event.waitUntil(self.clients.claim()); // Take control immediately
|
||||
});
|
||||
|
||||
@@ -52,7 +50,6 @@ function handleCheckAlarms(event, data) {
|
||||
data: dueAlarms
|
||||
});
|
||||
|
||||
console.log(`Checked ${allAlarms.length} alarms, found ${dueAlarms.length} due`);
|
||||
} catch (error) {
|
||||
console.error('Error checking alarms:', error);
|
||||
event.ports[0].postMessage({
|
||||
@@ -119,7 +116,6 @@ setInterval(async () => {
|
||||
});
|
||||
});
|
||||
|
||||
console.log('Requested alarm check from main app');
|
||||
} catch (error) {
|
||||
console.error('Background alarm check failed:', error);
|
||||
}
|
||||
@@ -151,6 +147,4 @@ self.addEventListener('notificationclick', event => {
|
||||
return self.clients.openWindow('/');
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
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| {
|
||||
if token.is_some() && !*alarm_storage_initialized {
|
||||
web_sys::console::log_1(&"🔔 Initializing alarm system...".into());
|
||||
|
||||
let alarm_storage = alarm_storage.clone();
|
||||
let alarm_scheduler = alarm_scheduler.clone();
|
||||
@@ -226,10 +225,7 @@ pub fn App() -> Html {
|
||||
// Request notification permission
|
||||
let scheduler = (*alarm_scheduler).clone();
|
||||
match scheduler.request_notification_permission().await {
|
||||
Ok(permission) => {
|
||||
web_sys::console::log_1(
|
||||
&format!("🔔 Notification permission: {:?}", permission).into()
|
||||
);
|
||||
Ok(_permission) => {
|
||||
}
|
||||
Err(e) => {
|
||||
web_sys::console::warn_1(
|
||||
@@ -261,7 +257,6 @@ pub fn App() -> Html {
|
||||
|
||||
alarm_check_interval.set(Some(interval));
|
||||
|
||||
web_sys::console::log_1(&"✅ Alarm system initialized successfully".into());
|
||||
}
|
||||
Err(e) => {
|
||||
web_sys::console::error_1(
|
||||
@@ -274,7 +269,6 @@ pub fn App() -> Html {
|
||||
// Clean up alarm system on logout
|
||||
alarm_check_interval.set(None); // This will drop and cancel the interval
|
||||
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)
|
||||
pub async fn init(&mut self) -> Result<(), wasm_bindgen::JsValue> {
|
||||
web_sys::console::log_1(&"AlarmStorage initialized with localStorage".into());
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user