decline & accept devices and protocol connection issues fixed

This commit is contained in:
RoyceDa
2026-01-31 04:55:00 +02:00
parent 22a1fd3a1a
commit a95db0d24b
6 changed files with 129 additions and 9 deletions

View File

@@ -6,22 +6,22 @@ import { dotCenterIfNeeded } from "../utils/utils";
const messageTemplate = `
**Attempt to login from a new device**
We detected a login to your account from **{os}** a new device **by seed phrase**. If this was you, you can safely ignore this message.
We detected a login to your account from **{ip}** a new device **by seed phrase**. If this was you, you can safely ignore this message.
**OS:** {os}
**Arch:** {os}
**IP:** {ip}
**Device:** {device}
**ID:** {deviceId}`
**ID:** {deviceId}`;
export function useDeviceMessage() {
const send = useSendSystemMessage("safe");
usePacket(0x09, (packet: PacketDeviceNew) => {
send(messageTemplate
.replace("{ip}", packet.getIpAddress())
.replace("{device}", packet.getDevice().deviceName)
.replace("{os}", packet.getDevice().deviceOs)
.replace("{deviceId}", dotCenterIfNeeded(packet.getDevice().deviceId, 12, 4))
.replaceAll("{ip}", packet.getIpAddress())
.replaceAll("{device}", packet.getDevice().deviceName)
.replaceAll("{os}", packet.getDevice().deviceOs)
.replaceAll("{deviceId}", dotCenterIfNeeded(packet.getDevice().deviceId, 12, 4))
);
}, []);
}