fix: only pass callback in emit_update if given

This commit is contained in:
Mose Müller 2023-08-02 12:06:22 +02:00
parent 5cb30688cf
commit 4ff07aa587

View File

@ -15,5 +15,9 @@ export const emit_update = (
value: unknown, value: unknown,
callback?: (ack: unknown) => void callback?: (ack: unknown) => void
) => { ) => {
if (callback) {
socket.emit('frontend_update', { name, parent_path, value }, callback); socket.emit('frontend_update', { name, parent_path, value }, callback);
} else {
socket.emit('frontend_update', { name, parent_path, value });
}
}; };