From 0dfbb7d973cbcd1b2e819b4d4a693549857be9a5 Mon Sep 17 00:00:00 2001 From: tjtanjin Date: Mon, 16 Sep 2024 01:42:48 +0800 Subject: [PATCH] fix: Fix toggle event data --- src/hooks/internal/usePathsInternal.ts | 8 -------- src/types/events/RcbToggleAudioEvent.ts | 3 ++- src/types/events/RcbToggleChatWindowEvent.ts | 3 ++- src/types/events/RcbToggleNotificationsEvent.ts | 3 ++- src/types/events/RcbToggleVoiceEvent.ts | 3 ++- 5 files changed, 8 insertions(+), 12 deletions(-) diff --git a/src/hooks/internal/usePathsInternal.ts b/src/hooks/internal/usePathsInternal.ts index e212aef7..90198acb 100644 --- a/src/hooks/internal/usePathsInternal.ts +++ b/src/hooks/internal/usePathsInternal.ts @@ -4,8 +4,6 @@ import { emitRcbEvent } from "../../services/RcbEventService"; import { usePathsContext } from "../../context/PathsContext"; import { useBotRefsContext } from "../../context/BotRefsContext"; import { useSettingsContext } from "../../context/SettingsContext"; -import { useStylesContext } from "../../context/StylesContext"; -import { useMessagesContext } from "../../context/MessagesContext"; import { useBotStatesContext } from "../../context/BotStatesContext"; import { Flow } from "../../types/Flow"; import { RcbEvent } from "../../constants/RcbEvent"; @@ -17,12 +15,6 @@ export const usePathsInternal = () => { // handles settings const { settings } = useSettingsContext(); - // handles styles - const { styles } = useStylesContext(); - - // handles messages - const { messages } = useMessagesContext(); - // handles paths const { paths, setPaths } = usePathsContext(); diff --git a/src/types/events/RcbToggleAudioEvent.ts b/src/types/events/RcbToggleAudioEvent.ts index 7c4cac4e..1451a9a5 100644 --- a/src/types/events/RcbToggleAudioEvent.ts +++ b/src/types/events/RcbToggleAudioEvent.ts @@ -4,5 +4,6 @@ import { RcbBaseEvent } from "../internal/events/RcbBaseEvent"; * Defines the data available for toggle audio event. */ export type RcbToggleAudioEvent = RcbBaseEvent<{ - toggleState: string; + currState: boolean; + newState: boolean; }>; \ No newline at end of file diff --git a/src/types/events/RcbToggleChatWindowEvent.ts b/src/types/events/RcbToggleChatWindowEvent.ts index 2a919af4..4c5c33c5 100644 --- a/src/types/events/RcbToggleChatWindowEvent.ts +++ b/src/types/events/RcbToggleChatWindowEvent.ts @@ -4,5 +4,6 @@ import { RcbBaseEvent } from "../internal/events/RcbBaseEvent"; * Defines the data available for toggle chat window event. */ export type RcbToggleChatWindowEvent = RcbBaseEvent<{ - toggleState: string; + currState: boolean; + newState: boolean; }>; \ No newline at end of file diff --git a/src/types/events/RcbToggleNotificationsEvent.ts b/src/types/events/RcbToggleNotificationsEvent.ts index 0b127a77..9ae87b27 100644 --- a/src/types/events/RcbToggleNotificationsEvent.ts +++ b/src/types/events/RcbToggleNotificationsEvent.ts @@ -4,5 +4,6 @@ import { RcbBaseEvent } from "../internal/events/RcbBaseEvent"; * Defines the data available for toggle notifications event. */ export type RcbToggleNotificationsEvent = RcbBaseEvent<{ - toggleState: string; + currState: boolean; + newState: boolean; }>; \ No newline at end of file diff --git a/src/types/events/RcbToggleVoiceEvent.ts b/src/types/events/RcbToggleVoiceEvent.ts index 7179c8a5..bb85258f 100644 --- a/src/types/events/RcbToggleVoiceEvent.ts +++ b/src/types/events/RcbToggleVoiceEvent.ts @@ -4,5 +4,6 @@ import { RcbBaseEvent } from "../internal/events/RcbBaseEvent"; * Defines the data available for toggle voice event. */ export type RcbToggleVoiceEvent = RcbBaseEvent<{ - toggleState: string; + currState: boolean; + newState: boolean; }>; \ No newline at end of file