Handle (invalid) null hass objects.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { FrigateCardError, MESSAGE_TYPE_PRIORITIES, Message } from '../types';
|
||||
import { FrigateCardError, MESSAGE_TYPE_PRIORITIES, Message, MessageType } from '../types';
|
||||
import { errorToConsole } from '../utils/basic';
|
||||
import { CardMessageAPI } from './types';
|
||||
|
||||
@@ -31,6 +31,12 @@ export class MessageManager {
|
||||
}
|
||||
}
|
||||
|
||||
public resetType(type: MessageType): void {
|
||||
if (this._message?.type === type) {
|
||||
this.reset();
|
||||
}
|
||||
}
|
||||
|
||||
public setErrorIfHigherPriority(error: unknown): void {
|
||||
// This object should accept unknown objects to be able to seamlessly
|
||||
// process arguments to catch() which can only be unknown/any.
|
||||
|
||||
Reference in New Issue
Block a user