Internal cleanup
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import mapboxgl from 'mapbox-gl';
|
||||
|
||||
import type { MapStyleName } from '@app/pages/Map/styles';
|
||||
import type { MapStyleName } from '@pages/Map/styles';
|
||||
import type { PayloadAction } from '@reduxjs/toolkit';
|
||||
import { createSlice } from '@reduxjs/toolkit';
|
||||
|
||||
|
||||
@@ -85,8 +85,6 @@ export const meshtasticSlice = createSlice({
|
||||
initialState,
|
||||
reducers: {
|
||||
addLogEvent: (state, action: PayloadAction<Types.LogEventPacket>) => {
|
||||
console.log(action.payload.packet);
|
||||
|
||||
state.logs.push(action.payload);
|
||||
},
|
||||
setDeviceStatus: (state, action: PayloadAction<Types.DeviceStatusEnum>) => {
|
||||
@@ -155,8 +153,6 @@ export const meshtasticSlice = createSlice({
|
||||
);
|
||||
|
||||
if (node) {
|
||||
console.log('node exists');
|
||||
|
||||
node.lastHeard = new Date(action.payload.lastHeard * 1000);
|
||||
node.snr.push(action.payload.snr);
|
||||
} else {
|
||||
@@ -204,23 +200,14 @@ export const meshtasticSlice = createSlice({
|
||||
state.radio.preferences = action.payload;
|
||||
},
|
||||
addMessage: (state, action: PayloadAction<MessageWithAck>) => {
|
||||
console.log(action.payload);
|
||||
|
||||
console.log(
|
||||
`${action.payload.message.packet.from} -> ${action.payload.message.packet.to}`,
|
||||
);
|
||||
state.chats[action.payload.message.packet.channel].lastInterraction =
|
||||
new Date();
|
||||
|
||||
if (action.payload.message.packet.to === 0xffffffff) {
|
||||
console.log('boradcast');
|
||||
|
||||
state.chats[action.payload.message.packet.channel].messages.push(
|
||||
action.payload,
|
||||
);
|
||||
} else {
|
||||
console.log('dm');
|
||||
|
||||
const dmIndex =
|
||||
action.payload.message.packet.from === state.radio.hardware.myNodeNum
|
||||
? action.payload.message.packet.to
|
||||
@@ -233,8 +220,6 @@ export const meshtasticSlice = createSlice({
|
||||
state,
|
||||
action: PayloadAction<{ chatIndex: number; messageId: number }>,
|
||||
) => {
|
||||
console.log(action.payload);
|
||||
|
||||
state.chats[action.payload.chatIndex].messages.map((message) => {
|
||||
if (message.message.packet.id === action.payload.messageId) {
|
||||
message.ack = true;
|
||||
|
||||
+3
-4
@@ -1,9 +1,8 @@
|
||||
import appReducer from '@core/slices/appSlice';
|
||||
import mapReducer from '@core/slices/mapSlice';
|
||||
import meshtasticReducer from '@core/slices/meshtasticSlice';
|
||||
import { configureStore } from '@reduxjs/toolkit';
|
||||
|
||||
import appReducer from './slices/appSlice';
|
||||
import mapReducer from './slices/mapSlice';
|
||||
import meshtasticReducer from './slices/meshtasticSlice';
|
||||
|
||||
export const store = configureStore({
|
||||
reducer: {
|
||||
app: appReducer,
|
||||
|
||||
Reference in New Issue
Block a user