diff --git a/src/App.tsx b/src/App.tsx
index efe4bbc7..937fc647 100644
--- a/src/App.tsx
+++ b/src/App.tsx
@@ -19,6 +19,7 @@ import {
setMyNodeInfo,
setPreferences,
setReady,
+ setUser,
} from '@core/slices/meshtasticSlice';
import { Protobuf, SettingsManager, Types } from '@meshtastic/meshtasticjs';
import { About } from '@pages/About';
@@ -70,6 +71,10 @@ const App = (): JSX.Element => {
dispatch(setMyNodeInfo(nodeInfo));
});
+ connection.onUserDataPacket.subscribe((user) => {
+ dispatch(setUser(user));
+ });
+
connection.onNodeInfoPacket.subscribe((nodeInfoPacket) =>
dispatch(addNode(nodeInfoPacket.data)),
);
@@ -117,6 +122,7 @@ const App = (): JSX.Element => {
return (): void => {
connection.onDeviceStatus.cancelAll();
connection.onMyNodeInfo.cancelAll();
+ connection.onUserDataPacket.cancelAll();
connection.onNodeInfoPacket.cancelAll();
connection.onAdminPacket.cancelAll();
connection.onMeshHeartbeat.cancelAll();
diff --git a/src/components/nodes/Node.tsx b/src/components/nodes/Node.tsx
deleted file mode 100644
index 4180e53f..00000000
--- a/src/components/nodes/Node.tsx
+++ /dev/null
@@ -1,31 +0,0 @@
-import React from 'react';
-
-import Avatar from 'boring-avatars';
-
-import type { Protobuf } from '@meshtastic/meshtasticjs';
-
-type DefaultDivProps = JSX.IntrinsicElements['div'];
-
-export interface NodeProps {
- node: Protobuf.NodeInfo;
-}
-
-export const Node = ({
- node,
- ...props
-}: NodeProps & DefaultDivProps): JSX.Element => {
- return (
-
-
-
{node.user?.longName}
-
- );
-};
diff --git a/src/components/templates/PrimaryTemplate.tsx b/src/components/templates/PrimaryTemplate.tsx
index 1179a11e..482fc8e4 100644
--- a/src/components/templates/PrimaryTemplate.tsx
+++ b/src/components/templates/PrimaryTemplate.tsx
@@ -32,7 +32,9 @@ export const PrimaryTemplate = ({
- {children}
+
+ {children}
+
{footer && (
diff --git a/src/core/slices/meshtasticSlice.ts b/src/core/slices/meshtasticSlice.ts
index fcb103f6..9285bb18 100644
--- a/src/core/slices/meshtasticSlice.ts
+++ b/src/core/slices/meshtasticSlice.ts
@@ -16,6 +16,7 @@ interface AppState {
lastMeshInterraction: number;
ready: boolean;
myNodeInfo: Protobuf.MyNodeInfo;
+ user: Protobuf.User;
positionPackets: Types.PositionPacket[];
nodes: Protobuf.NodeInfo[];
channels: Protobuf.Channel[];
@@ -30,6 +31,7 @@ const initialState: AppState = {
lastMeshInterraction: 0,
ready: false,
myNodeInfo: Protobuf.MyNodeInfo.create(),
+ user: Protobuf.User.create(),
positionPackets: [],
nodes: [],
channels: [],
@@ -56,6 +58,9 @@ export const meshtasticSlice = createSlice({
setMyNodeInfo: (state, action: PayloadAction
) => {
state.myNodeInfo = action.payload;
},
+ setUser: (state, action: PayloadAction) => {
+ state.user = action.payload;
+ },
addPositionPacket: (state, action: PayloadAction) => {
state.positionPackets.push(action.payload);
},
@@ -124,6 +129,7 @@ export const {
setLastMeshInterraction,
setReady,
setMyNodeInfo,
+ setUser,
addPositionPacket,
addNode,
addChannel,
diff --git a/src/pages/Nodes/Index.tsx b/src/pages/Nodes/Index.tsx
index 6dbea95d..21fecac1 100644
--- a/src/pages/Nodes/Index.tsx
+++ b/src/pages/Nodes/Index.tsx
@@ -9,6 +9,7 @@ import { Drawer } from '@components/generic/Drawer';
import { SidebarItem } from '@components/generic/SidebarItem';
import { Tab } from '@headlessui/react';
import { XCircleIcon } from '@heroicons/react/outline';
+import { Protobuf } from '@meshtastic/meshtasticjs';
import { Node } from './Node';
@@ -55,7 +56,11 @@ export const Nodes = (): JSX.Element => {
{({ selected }): JSX.Element => (
{
const { t } = useTranslation();
- const radioConfig = useAppSelector((state) => state.meshtastic.preferences);
+ const user = useAppSelector((state) => state.meshtastic.user);
- const { register, handleSubmit, formState } =
- useForm({
- defaultValues: radioConfig,
- });
+ const { register, handleSubmit, formState } = useForm({
+ defaultValues: user,
+ });
const onSubmit = handleSubmit((data) => {
- void connection.setPreferences(data);
+ void connection.setOwner(data);
});
return (
@@ -54,14 +53,9 @@ export const Device = ({ navOpen, setNavOpen }: DeviceProps): JSX.Element => {
}
>
-