1
0
mirror of https://github.com/home-assistant/frontend.git synced 2025-12-20 02:38:53 +00:00

Fix multiple races in logbook subscriptions (#12878)

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
This commit is contained in:
J. Nick Koston
2022-06-06 19:23:56 -10:00
committed by GitHub
parent a47a0ed716
commit b1a3996cf1
2 changed files with 45 additions and 14 deletions

View File

@@ -1,4 +1,4 @@
import { HassEntity, UnsubscribeFunc } from "home-assistant-js-websocket";
import { HassEntity } from "home-assistant-js-websocket";
import {
BINARY_STATE_OFF,
BINARY_STATE_ON,
@@ -177,7 +177,7 @@ export const subscribeLogbook = (
endDate: string,
entityIds?: string[],
deviceIds?: string[]
): Promise<UnsubscribeFunc> => {
): Promise<() => Promise<void>> => {
// If all specified filters are empty lists, we can return an empty list.
if (
(entityIds || deviceIds) &&