MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / clearFiles

Function clearFiles

web/scripts/ragnar_modern.js:13551–13600  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

13549 data = null;
13550 }
13551
13552 if (!response.ok || (data && data.success === false)) {
13553 const errorMessage = data && (data.error || data.message)
13554 ? (data.error || data.message)
13555 : `Request failed (${response.status})`;
13556 throw new Error(errorMessage);
13557 }
13558
13559 return data || { success: true };
13560}
13561
13562async function loadConnectData() {
13563 try {
13564 // Load Wi-Fi interfaces first so dropdowns are populated before status updates
13565 await loadWifiInterfaces();
13566
13567 // Refresh Wi-Fi and Bluetooth status in parallel to shorten the loading time
13568 console.log('Loading connect tab, refreshing connectivity status...');
13569 await Promise.all([
13570 refreshWifiStatus(),
13571 refreshEthernetStatus(),
13572 refreshBluetoothStatus()
13573 ]);
13574 } catch (error) {
13575 console.error('Error loading connect data:', error);
13576 }
13577}
13578
13579async function loadFilesData() {
13580 try {
13581 displayDirectoryTree();
13582 loadFiles('/');
13583 // Don't automatically load images - user must click "Load Images" button
13584 } catch (error) {
13585 console.error('Error loading files data:', error);
13586 }
13587}
13588
13589// ============================================================================
13590// PWNAGOTCHI VISIBILITY MANAGEMENT
13591// ============================================================================
13592
13593function arePwnFeaturesEnabled() {
13594 return localStorage.getItem('pwnagotchi-enabled') === 'true';
13595}
13596
13597function applyPwnVisibilityPreference(isEnabled) {
13598 const pwnSection = document.getElementById('pwnagotchi-section');
13599 if (pwnSection) {
13600 pwnSection.style.display = isEnabled ? 'block' : 'none';
13601 }
13602 updatePwnDiscoveredCard(pwnStatus);
13603

Callers

nothing calls this directly

Calls 7

showFileConfirmModalFunction · 0.70
showFileLoadingFunction · 0.70
networkAwareFetchFunction · 0.70
showFileSuccessFunction · 0.70
refreshFilesFunction · 0.70
showFileErrorFunction · 0.70
closeFileModalFunction · 0.70

Tested by

no test coverage detected