Fix view-related querystring action race condition

This commit is contained in:
Dermot Duffy
2023-06-21 08:41:56 -07:00
parent ed1780582f
commit e1320c4d71
4 changed files with 156 additions and 40 deletions
+7 -9
View File
@@ -209,15 +209,11 @@ const frigateCardCustomActionsBaseSchema = customActionSchema.extend({
const FRIGATE_CARD_GENERAL_ACTIONS = [
'camera_ui',
'clip',
'clips',
'default',
'diagnostics',
'expand',
'download',
'fullscreen',
'image',
'live',
'menu_toggle',
'mute',
'live_substream_on',
@@ -226,15 +222,11 @@ const FRIGATE_CARD_GENERAL_ACTIONS = [
'microphone_unmute',
'play',
'pause',
'recording',
'recordings',
'screenshot',
'snapshot',
'snapshots',
'timeline',
'unmute',
] as const;
const FRIGATE_CARD_ACTIONS = [
...FRIGATE_CARD_VIEWS_USER_SPECIFIED,
...FRIGATE_CARD_GENERAL_ACTIONS,
'camera_select',
'live_substream_select',
@@ -242,6 +234,11 @@ const FRIGATE_CARD_ACTIONS = [
] as const;
export type FrigateCardAction = (typeof FRIGATE_CARD_ACTIONS)[number];
const frigateCardViewActionSchema = frigateCardCustomActionsBaseSchema.extend({
frigate_card_action: z.enum(FRIGATE_CARD_VIEWS_USER_SPECIFIED),
});
export type FrigateCardViewAction = z.infer<typeof frigateCardViewActionSchema>;
const frigateCardGeneralActionSchema = frigateCardCustomActionsBaseSchema.extend({
frigate_card_action: z.enum(FRIGATE_CARD_GENERAL_ACTIONS),
});
@@ -261,6 +258,7 @@ const frigateCardMediaPlayerActionSchema = frigateCardCustomActionsBaseSchema.ex
});
export const frigateCardCustomActionSchema = z.union([
frigateCardViewActionSchema,
frigateCardGeneralActionSchema,
frigateCardCameraSelectActionSchema,
frigateCardLiveDependencySelectActionSchema,