mirror of
https://github.com/meshtastic/web.git
synced 2026-07-31 23:16:37 -04:00
The persisted message Zustand store had no remaining consumers — chat history, drafts, and message state all live on the SDK ChatClient (SqlocalMessageRepository). The messageStore Zustand surface (saveMessage, getMessages, setMessageState, getDraft, setDraft, clearDraft, deleteAllMessages, clearMessageByMessageId, plus the addMessageStore / removeMessageStore / getMessageStore / setNodeNum plumbing) is now fully unused. Collapse messageStore/index.ts to just the MessageState / MessageType enums + the legacy `Message` shape that the useChatLegacy adapter and a couple of message components still consume. Delete the Zustand implementation and its 32-test suite. Other knock-on cleanups in this commit: - Drop the _messageStore param from subscribeAll (unused after the saveMessage-from-subscriptions retirement). - Drop addMessageStore wiring from useConnections, removeMessageStore from FactoryResetDeviceDialog, setNodeNum from useNewNodeNum. - Drop the message branch from the router context (no readers). - RefreshKeysDialog stops keying off `useMessages().activeChat` (which was permanently 0 — a dead handle that quietly broke key-refresh UX). Use the SDK NodesClient's first error directly via `useNodeErrors()[0]`. The dialog manager already opens the dialog on PKI_UNKNOWN_PUBKEY, so picking the first error matches the intended flow.