@@ -27,6 +27,7 @@ import { ResizableBox } from "react-resizable"
2727
2828// Redux
2929import { useDispatch , useSelector } from "react-redux"
30+ import { selectConnectedToDrone } from "./redux/slices/droneConnectionSlice"
3031import {
3132 selectAircraftTypeString ,
3233 selectBatteryData ,
@@ -35,14 +36,13 @@ import {
3536 selectGPSRawInt ,
3637 selectNotificationSound ,
3738 selectRSSI ,
38- soundPlayed ,
39+ soundPlayed
3940} from "./redux/slices/droneInfoSlice"
40- import { selectMessages } from "./redux/slices/statusTextSlice"
4141import {
4242 notificationShown ,
4343 selectNotificationQueue ,
4444} from "./redux/slices/notificationSlice"
45- import { selectConnectedToDrone } from "./redux/slices/droneConnectionSlice "
45+ import { selectMessages } from "./redux/slices/statusTextSlice "
4646
4747// Helper javascript files
4848import { GPS_FIX_TYPES } from "./helpers/mavlinkConstants"
@@ -70,9 +70,6 @@ const tailwindColors = resolveConfig(tailwindConfig).theme.colors
7070// Sounds
7171import armSound from "./assets/sounds/armed.mp3"
7272import disarmSound from "./assets/sounds/disarmed.mp3"
73- // import { AlertCategory, AlertSeverity } from "./components/dashboard/alert"
74- // import { useAlerts } from "./components/dashboard/alertProvider"
75- // import { useSettings } from "./helpers/settings"
7673
7774export default function Dashboard ( ) {
7875 const dispatch = useDispatch ( )
@@ -135,7 +132,7 @@ export default function Dashboard() {
135132 // Show queued notifications
136133 useEffect ( ( ) => {
137134 if ( notificationQueue . length !== 0 ) {
138- ; ( notificationQueue [ 0 ] . type === "error"
135+ ; ( notificationQueue [ 0 ] . type === "error"
139136 ? showErrorNotification
140137 : showSuccessNotification ) ( notificationQueue [ 0 ] . message )
141138 dispatch ( notificationShown ( ) )
@@ -155,37 +152,6 @@ export default function Dashboard() {
155152 } )
156153 }
157154
158- // NEED TO FIX THIS BEFORE WE MERGE KUSH/BEN
159- // Alerts
160- // const { getSetting } = useSettings()
161- // const { dispatchAlert, dismissAlert } = useAlerts()
162- // const highestAltitudeRef = useRef(0)
163-
164- // function updateAltitudeAlert(msg) {
165- // if (msg.alt > highestAltitudeRef.current)
166- // return (highestAltitudeRef.current = msg.alt)
167- // const altitudes = getSetting("Dashboard.altitudeAlerts")
168- // altitudes.sort((a1, a2) => a1 - a2)
169-
170- // for (const [i, altitude] of altitudes.entries()) {
171- // if (highestAltitudeRef.current > altitude && msg.alt < altitude) {
172- // dispatchAlert({
173- // category: AlertCategory.Altitude,
174- // severity:
175- // i == 0
176- // ? AlertSeverity.Red
177- // : i == altitudes.length - 1
178- // ? AlertSeverity.Yellow
179- // : AlertSeverity.Orange,
180- // jsx: <>Caution! You've fallen below {altitude}m</>,
181- // })
182- // return
183- // }
184- // }
185-
186- // dismissAlert(AlertCategory.Altitude)
187- // }
188-
189155 function calcBigTextFontSize ( ) {
190156 let w = telemetryPanelSize . width
191157 const BREAKPOINT_SM = 350.0
@@ -248,9 +214,8 @@ export default function Dashboard() {
248214 />
249215 < StatusSection
250216 icon = { < IconGps /> }
251- value = { `(${ lat !== undefined ? lat . toFixed ( 6 ) : 0 } , ${
252- lon !== undefined ? lon . toFixed ( 6 ) : 0
253- } )`}
217+ value = { `(${ lat !== undefined ? lat . toFixed ( 6 ) : 0 } , ${ lon !== undefined ? lon . toFixed ( 6 ) : 0
218+ } )`}
254219 tooltip = "GPS (lat, lon)"
255220 />
256221 < StatusSection
0 commit comments