mirror of
https://github.com/chirpstack/chirpstack.git
synced 2025-01-31 07:55:23 +00:00
parent
464937169b
commit
f81b868a31
@ -77,6 +77,8 @@ class DeviceStore extends EventEmitter {
|
||||
return;
|
||||
}
|
||||
|
||||
this.emit("change");
|
||||
|
||||
notification.success({
|
||||
message: "Device updated",
|
||||
duration: 3,
|
||||
|
@ -46,6 +46,15 @@ function DeviceLayout(props: IProps) {
|
||||
const [lastSeenAt, setLastSeenAt] = useState<Date | undefined>(undefined);
|
||||
|
||||
useEffect(() => {
|
||||
DeviceStore.on("change", loadDevice);
|
||||
loadDevice();
|
||||
|
||||
return () => {
|
||||
DeviceStore.removeAllListeners("change");
|
||||
};
|
||||
}, [devEui]);
|
||||
|
||||
const loadDevice = () => {
|
||||
let req = new GetDeviceRequest();
|
||||
req.setDevEui(devEui!);
|
||||
|
||||
@ -62,7 +71,7 @@ function DeviceLayout(props: IProps) {
|
||||
setDeviceProfile(resp.getDeviceProfile());
|
||||
});
|
||||
});
|
||||
}, [devEui]);
|
||||
}
|
||||
|
||||
const deleteDevice = () => {
|
||||
let req = new DeleteDeviceRequest();
|
||||
|
Loading…
x
Reference in New Issue
Block a user