diff --git a/frontend/src/components/StatusBar.tsx b/frontend/src/components/StatusBar.tsx index 698fcc8..ee55c98 100644 --- a/frontend/src/components/StatusBar.tsx +++ b/frontend/src/components/StatusBar.tsx @@ -13,7 +13,11 @@ import { api } from '../api'; import { toast } from './ui/sonner'; import { handleKeyboardActivate } from '../utils/a11y'; import { applyTheme, getSavedTheme, THEME_CHANGE_EVENT } from '../utils/theme'; -import { getShowBatteryPercent, getShowBatteryVoltage } from '../utils/batteryDisplay'; +import { + BATTERY_DISPLAY_CHANGE_EVENT, + getShowBatteryPercent, + getShowBatteryVoltage, +} from '../utils/batteryDisplay'; import { cn } from '@/lib/utils'; // Meshtastic default OCV table (meshtastic/firmware src/power.h) @@ -43,8 +47,6 @@ function mvToPercent(mv: number): number { return 0; } -export const BATTERY_DISPLAY_CHANGE_EVENT = 'remoteterm-battery-display-change'; - interface StatusBarProps { health: HealthStatus | null; config: RadioConfig | null; diff --git a/frontend/src/components/settings/SettingsLocalSection.tsx b/frontend/src/components/settings/SettingsLocalSection.tsx index 6774c56..b706dea 100644 --- a/frontend/src/components/settings/SettingsLocalSection.tsx +++ b/frontend/src/components/settings/SettingsLocalSection.tsx @@ -29,12 +29,12 @@ import { } from '../../utils/fontScale'; import { getAutoFocusInputEnabled, setAutoFocusInputEnabled } from '../../utils/autoFocusInput'; import { + BATTERY_DISPLAY_CHANGE_EVENT, getShowBatteryPercent, setShowBatteryPercent as saveBatteryPercent, getShowBatteryVoltage, setShowBatteryVoltage as saveBatteryVoltage, } from '../../utils/batteryDisplay'; -import { BATTERY_DISPLAY_CHANGE_EVENT } from '../StatusBar'; export function SettingsLocalSection({ onLocalLabelChange, diff --git a/frontend/src/utils/batteryDisplay.ts b/frontend/src/utils/batteryDisplay.ts index 8ce1af4..3617bf0 100644 --- a/frontend/src/utils/batteryDisplay.ts +++ b/frontend/src/utils/batteryDisplay.ts @@ -1,3 +1,5 @@ +export const BATTERY_DISPLAY_CHANGE_EVENT = 'remoteterm-battery-display-change'; + const PERCENT_KEY = 'remoteterm-show-battery-percent'; const VOLTAGE_KEY = 'remoteterm-show-battery-voltage';