|
|
@ -13,10 +13,9 @@ import icon_4_u from './assets/tabIcon/icon_tab4_u.svg'; |
|
|
|
import { appWebview, bridgeOb, emitBridgeEvent, registerBridgeFunc } from './utils/bridge'; |
|
|
|
import { useAppDispatch } from './utils/hooks'; |
|
|
|
import { addNewPoint, updateTaskState } from './store/features/measureSlice'; |
|
|
|
import { DeviceStatus, TrackRecordSig } from './services/wsTypes'; |
|
|
|
import { updateBleList, updateDevice, updateSyncProgress } from './store/features/contextSlice'; |
|
|
|
import { createWebSocket, sharedWsUrl } from './services/socket'; |
|
|
|
import { updateUploadStatus } from './store/features/historySlice'; |
|
|
|
import { fetchRailTypes } from './store/features/baseData'; |
|
|
|
|
|
|
|
const BottomBar = () => { |
|
|
|
const navigate = useNavigate(); |
|
|
@ -70,11 +69,12 @@ const BottomBar = () => { |
|
|
|
|
|
|
|
function App() { |
|
|
|
const dispatch = useAppDispatch(); |
|
|
|
dispatch(fetchRailTypes()); |
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
const subscription = bridgeOb.subscribe((datagram) => { |
|
|
|
if (datagram.type === 'measure-event') { |
|
|
|
dispatch(updateTaskState(datagram.data.event)); |
|
|
|
dispatch(updateTaskState(datagram.data)); |
|
|
|
} else if (datagram.type === 'measure-point') { |
|
|
|
dispatch(addNewPoint(datagram.data)); |
|
|
|
} else if (datagram.type === 'peripheral-status') { |
|
|
|