A free and open source instant messaging and VoIP chat app built for friends, groups, and communities.
refactor(app): rename ComponentDispatch to ComponentBus (#1844)
Hampusc285854b7145
diff --git a/fluxer_app/src/features/app/components/dialogs/components/DesktopSettingsView.tsx b/fluxer_app/src/features/app/components/dialogs/components/DesktopSettingsView.tsxindex e2a5dca65..fbf8f3d24 100644--- a/fluxer_app/src/features/app/components/dialogs/components/DesktopSettingsView.tsx+++ b/fluxer_app/src/features/app/components/dialogs/components/DesktopSettingsView.tsx@@ -31,7 +31,7 @@ import {SEARCH_SETTINGS_PLACEHOLDER_DESCRIPTOR,SIGN_OUT_DESCRIPTOR,} from '@app/features/i18n/utils/CommonMessageDescriptors';-import {ComponentDispatch} from '@app/features/platform/utils/ComponentBus';+import {ComponentBus} from '@app/features/platform/utils/ComponentBus';import {remFromPx} from '@app/features/theme/layout/RemFromPx';import {Button} from '@app/features/ui/button/Button';import * as ModalCommands from '@app/features/ui/commands/ModalCommands';@@ -223,7 +223,7 @@ const SidebarSections: React.FC<SidebarSectionsProps> = observer(scrollSpyContext.scrollToSection(sectionId);return;}- ComponentDispatch.dispatch('USER_SETTINGS_TAB_SELECT', {tab: tabType, section: sectionId});+ ComponentBus.dispatch('USER_SETTINGS_TAB_SELECT', {tab: tabType, section: sectionId});};return (<SettingsModalSidebarSubItemsdiff --git a/fluxer_app/src/features/app/components/dialogs/components/PlutoniumContent.tsx b/fluxer_app/src/features/app/components/dialogs/components/PlutoniumContent.tsxindex e0786c6be..33450cdaa 100644--- a/fluxer_app/src/features/app/components/dialogs/components/PlutoniumContent.tsx+++ b/fluxer_app/src/features/app/components/dialogs/components/PlutoniumContent.tsx@@ -21,7 +21,7 @@ import {SubscriptionCard} from '@app/features/app/components/dialogs/components/import {PREMIUM_PRODUCT_FULL_NAME, PREMIUM_PRODUCT_NAME} from '@app/features/app/config/I18nDisplayConstants';import GeoIP from '@app/features/app/state/GeoIP';import Guilds from '@app/features/guild/state/Guilds';-import {ComponentDispatch} from '@app/features/platform/utils/ComponentBus';+import {ComponentBus} from '@app/features/platform/utils/ComponentBus';import * as PremiumCommands from '@app/features/premium/commands/PremiumCommands';import PremiumState from '@app/features/premium/state/PremiumState';import {@@ -122,7 +122,7 @@ export const PlutoniumContent = observer(({defaultGiftMode = false}: PlutoniumCoperksSectionRef.current?.scrollIntoView({behavior: 'auto', block: 'start'});}, []);const navigateToRedeemGift = useCallback(() => {- ComponentDispatch.dispatch('USER_SETTINGS_TAB_SELECT', {tab: 'gift_inventory'});+ ComponentBus.dispatch('USER_SETTINGS_TAB_SELECT', {tab: 'gift_inventory'});}, []);const handleCancelSubscriptionConfirmed = useCallback(() => {ModalCommands.push(diff --git a/fluxer_app/src/features/app/components/dialogs/components/plutonium/GiftInventoryBanner.tsx b/fluxer_app/src/features/app/components/dialogs/components/plutonium/GiftInventoryBanner.tsxindex abca1169a..1646d0945 100644--- a/fluxer_app/src/features/app/components/dialogs/components/plutonium/GiftInventoryBanner.tsx+++ b/fluxer_app/src/features/app/components/dialogs/components/plutonium/GiftInventoryBanner.tsx@@ -1,7 +1,7 @@// SPDX-License-Identifier: AGPL-3.0-or-laterimport styles from '@app/features/app/components/dialogs/components/plutonium/GiftInventoryBanner.module.css';-import {ComponentDispatch} from '@app/features/platform/utils/ComponentBus';+import {ComponentBus} from '@app/features/platform/utils/ComponentBus';import {shouldShowPremiumFeatures} from '@app/features/premium/utils/PremiumUtils';import {Button} from '@app/features/ui/button/Button';import type {User} from '@app/features/user/models/User';@@ -37,7 +37,7 @@ export const GiftInventoryBanner: React.FC<GiftInventoryBannerProps> = observer(<Buttonvariant="secondary"small- onClick={() => ComponentDispatch.dispatch('USER_SETTINGS_TAB_SELECT', {tab: 'gift_inventory'})}+ onClick={() => ComponentBus.dispatch('USER_SETTINGS_TAB_SELECT', {tab: 'gift_inventory'})}data-flx="app.plutonium.gift-inventory-banner.button.dispatch"><Trans>View gifts</Trans>diff --git a/fluxer_app/src/features/app/components/layout/GuildLayout.tsx b/fluxer_app/src/features/app/components/layout/GuildLayout.tsxindex 57f932878..7b23512b6 100644--- a/fluxer_app/src/features/app/components/layout/GuildLayout.tsx+++ b/fluxer_app/src/features/app/components/layout/GuildLayout.tsx@@ -27,7 +27,7 @@ import SelectedChannel from '@app/features/navigation/state/SelectedChannel';import Permission from '@app/features/permissions/state/Permission';import * as PermissionUtils from '@app/features/permissions/utils/PermissionUtils';import {useParams} from '@app/features/platform/components/router/RouterReact';-import {ComponentDispatch} from '@app/features/platform/utils/ComponentBus';+import {ComponentBus} from '@app/features/platform/utils/ComponentBus';import * as ModalCommands from '@app/features/ui/commands/ModalCommands';import {modal} from '@app/features/ui/commands/ModalCommands';import * as NagbarCommands from '@app/features/ui/commands/NagbarCommands';@@ -433,7 +433,7 @@ export const GuildLayout = observer(({children}: {children: React.ReactNode}) =>useEffect(() => {if (prevNagbarCount.current !== nagbarCount) {prevNagbarCount.current = nagbarCount;- ComponentDispatch.dispatch('LAYOUT_RESIZED');+ ComponentBus.dispatch('LAYOUT_RESIZED');}}, [nagbarCount]);useEffect(() => {diff --git a/fluxer_app/src/features/app/components/layout/GuildsLayout.tsx b/fluxer_app/src/features/app/components/layout/GuildsLayout.tsxindex ccb80dac4..649d05591 100644--- a/fluxer_app/src/features/app/components/layout/GuildsLayout.tsx+++ b/fluxer_app/src/features/app/components/layout/GuildsLayout.tsx@@ -90,7 +90,7 @@ import {openMacPermissionsModal} from '@app/features/permissions/system/commandsimport MacPermissions from '@app/features/permissions/system/state/MacPermissions';import {useLocation} from '@app/features/platform/components/router/RouterReact';import {Platform} from '@app/features/platform/types/Platform';-import {ComponentDispatch} from '@app/features/platform/utils/ComponentBus';+import {ComponentBus} from '@app/features/platform/utils/ComponentBus';import ReadStates from '@app/features/read_state/state/ReadStates';import {getRemScaleForDocument} from '@app/features/theme/layout/RemFromPx';import {AxisOrientation, type VerticalEdge} from '@app/features/ui/AxisOrientation';@@ -2166,7 +2166,7 @@ export const GuildsLayout = observer(({children}: {children: React.ReactNode}) =useEffect(() => {if (prevNagbarCount.current !== activeNagbars.length) {prevNagbarCount.current = activeNagbars.length;- ComponentDispatch.dispatch('LAYOUT_RESIZED');+ ComponentBus.dispatch('LAYOUT_RESIZED');}}, [activeNagbars.length]);useEffect(() => {diff --git a/fluxer_app/src/features/app/components/layout/KeyboardModeListener.ts b/fluxer_app/src/features/app/components/layout/KeyboardModeListener.tsindex 72a130ed9..b2914ffaf 100644--- a/fluxer_app/src/features/app/components/layout/KeyboardModeListener.ts+++ b/fluxer_app/src/features/app/components/layout/KeyboardModeListener.ts@@ -3,7 +3,7 @@import {Routes} from '@app/app/Routes';import {CHANNEL_TEXTAREA_SELECTOR} from '@app/features/app/keybindings/utils/EditableElement';import {useLocation} from '@app/features/platform/components/router/RouterReact';-import {ComponentDispatch} from '@app/features/platform/utils/ComponentBus';+import {ComponentBus} from '@app/features/platform/utils/ComponentBus';import FocusRingManager from '@app/features/ui/focus_ring/FocusRingManager';import KeyboardMode from '@app/features/ui/state/KeyboardMode';import {@@ -61,7 +61,7 @@ export const KeyboardModeListener = observer(() => {const composer = document.querySelector<HTMLTextAreaElement>(CHANNEL_TEXTAREA_SELECTOR);if (canRedirectTabToComposer(composer)) {event.preventDefault();- ComponentDispatch.dispatch('FOCUS_TEXTAREA', {enterKeyboardMode: true});+ ComponentBus.dispatch('FOCUS_TEXTAREA', {enterKeyboardMode: true});return;}}diff --git a/fluxer_app/src/features/app/keybindings/keybind_manager/handlers/defaultHandlers.ts b/fluxer_app/src/features/app/keybindings/keybind_manager/handlers/defaultHandlers.tsindex 48aca7d0f..a3e278368 100644--- a/fluxer_app/src/features/app/keybindings/keybind_manager/handlers/defaultHandlers.ts+++ b/fluxer_app/src/features/app/keybindings/keybind_manager/handlers/defaultHandlers.ts@@ -31,7 +31,7 @@ import SelectedChannel from '@app/features/navigation/state/SelectedChannel';import * as RouterUtils from '@app/features/navigation/utils/RouterUtils';import MentionFeed from '@app/features/notification/state/MentionFeed';import Permission from '@app/features/permissions/state/Permission';-import {ComponentDispatch} from '@app/features/platform/utils/ComponentBus';+import {ComponentBus} from '@app/features/platform/utils/ComponentBus';import * as ReadStateCommands from '@app/features/read_state/commands/ReadStateCommands';import ReadStates from '@app/features/read_state/state/ReadStates';import QuickSwitcher from '@app/features/search/state/QuickSwitcher';@@ -128,7 +128,7 @@ export function registerDefaultKeybindHandlers(host: HandlerHost, i18n: I18n): v});host.register('misc_search', ({type}) => {if (type !== 'press') return;- ComponentDispatch.dispatch('MESSAGE_SEARCH_OPEN');+ ComponentBus.dispatch('MESSAGE_SEARCH_OPEN');});host.register('voice_toggle_mute', ({type}) => {if (type !== 'press') return;@@ -283,13 +283,13 @@ export function registerDefaultKeybindHandlers(host: HandlerHost, i18n: I18n): v});host.register('voice_toggle_soundboard', ({type}) => {if (type !== 'press') return;- ComponentDispatch.dispatch('SOUNDBOARD_TOGGLE');+ ComponentBus.dispatch('SOUNDBOARD_TOGGLE');});host.register('voice_toggle_compact_call_view', ({type}) => {if (type !== 'press') return;const channelId = host.currentChannelId;if (!channelId) return;- ComponentDispatch.dispatch('COMPACT_VOICE_CALL_EXPANSION_TOGGLE', {channelId});+ ComponentBus.dispatch('COMPACT_VOICE_CALL_EXPANSION_TOGGLE', {channelId});});host.register('chat_copy_channel_link', ({type}) => {if (type !== 'press') return;@@ -304,15 +304,15 @@ export function registerDefaultKeybindHandlers(host: HandlerHost, i18n: I18n): vif (type !== 'press') return;const channelId = host.currentChannelId;if (!channelId) return;- ComponentDispatch.dispatch('FOCUS_TEXTAREA', {channelId});+ ComponentBus.dispatch('FOCUS_TEXTAREA', {channelId});});host.register('chat_scroll_up', ({type}) => {if (type !== 'press') return;- ComponentDispatch.dispatch('SCROLL_PAGE_UP');+ ComponentBus.dispatch('SCROLL_PAGE_UP');});host.register('chat_scroll_down', ({type}) => {if (type !== 'press') return;- ComponentDispatch.dispatch('SCROLL_PAGE_DOWN');+ ComponentBus.dispatch('SCROLL_PAGE_DOWN');});host.register('chat_jump_oldest_unread', ({type}) => {if (type !== 'press') return;@@ -328,7 +328,7 @@ export function registerDefaultKeybindHandlers(host: HandlerHost, i18n: I18n): vif (!channelId) return;if (requestChannelComposerAffordanceDismissal(channelId)) return;if (ReadStates.hasUnread(channelId)) {- ComponentDispatch.dispatch('ESCAPE_PRESSED', {channelId});+ ComponentBus.dispatch('ESCAPE_PRESSED', {channelId});}});host.register('chat_mark_guild_read', ({type}) => {@@ -465,15 +465,15 @@ export function registerDefaultKeybindHandlers(host: HandlerHost, i18n: I18n): v});host.register('chat_toggle_pins', ({type}) => {if (type !== 'press') return;- ComponentDispatch.dispatch('CHANNEL_PINS_OPEN');+ ComponentBus.dispatch('CHANNEL_PINS_OPEN');});host.register('chat_toggle_inbox', ({type}) => {if (type !== 'press') return;- ComponentDispatch.dispatch('INBOX_OPEN');+ ComponentBus.dispatch('INBOX_OPEN');});host.register('chat_toggle_member_list', ({type}) => {if (type !== 'press') return;- ComponentDispatch.dispatch('CHANNEL_MEMBER_LIST_TOGGLE');+ ComponentBus.dispatch('CHANNEL_MEMBER_LIST_TOGGLE');});host.register('chat_toggle_emoji', ({type}) => {if (type !== 'press') return;@@ -481,38 +481,38 @@ export function registerDefaultKeybindHandlers(host: HandlerHost, i18n: I18n): vif (!channelId) return;const editingMessageId = MessageEdit.getEditingMessageId(channelId);if (editingMessageId) {- ComponentDispatch.dispatch('EDITING_EXPRESSION_PICKER_TAB_TOGGLE', {+ ComponentBus.dispatch('EDITING_EXPRESSION_PICKER_TAB_TOGGLE', {channelId,messageId: editingMessageId,tab: 'emojis',});return;}- ComponentDispatch.dispatch('EXPRESSION_PICKER_TAB_TOGGLE', {channelId, tab: 'emojis'});+ ComponentBus.dispatch('EXPRESSION_PICKER_TAB_TOGGLE', {channelId, tab: 'emojis'});});host.register('chat_toggle_gif', ({type}) => {if (type !== 'press') return;const channelId = host.currentChannelId;if (!channelId) return;- ComponentDispatch.dispatch('EXPRESSION_PICKER_TAB_TOGGLE', {channelId, tab: 'gifs'});+ ComponentBus.dispatch('EXPRESSION_PICKER_TAB_TOGGLE', {channelId, tab: 'gifs'});});host.register('chat_toggle_sticker', ({type}) => {if (type !== 'press') return;const channelId = host.currentChannelId;if (!channelId) return;- ComponentDispatch.dispatch('EXPRESSION_PICKER_TAB_TOGGLE', {channelId, tab: 'stickers'});+ ComponentBus.dispatch('EXPRESSION_PICKER_TAB_TOGGLE', {channelId, tab: 'stickers'});});host.register('chat_toggle_saved_media', ({type}) => {if (type !== 'press') return;const channelId = host.currentChannelId;if (!channelId) return;- ComponentDispatch.dispatch('EXPRESSION_PICKER_TAB_TOGGLE', {channelId, tab: 'memes'});+ ComponentBus.dispatch('EXPRESSION_PICKER_TAB_TOGGLE', {channelId, tab: 'memes'});});host.register('chat_send_voice_message', ({type}) => {if (type !== 'press') return;const channelId = host.currentChannelId ?? Navigation.channelId;if (!channelId) return;- const textareaResult = ComponentDispatch.dispatchToFirstResult(+ const textareaResult = ComponentBus.dispatchToFirstResult('TEXTAREA_SEND_VOICE_MESSAGE',{channelId},(result) => result === true || result === false,@@ -537,13 +537,13 @@ export function registerDefaultKeybindHandlers(host: HandlerHost, i18n: I18n): vif (type !== 'press') return;const channelId = host.currentChannelId;if (!channelId) return;- ComponentDispatch.dispatch('FOCUS_TEXTAREA', {channelId});+ ComponentBus.dispatch('FOCUS_TEXTAREA', {channelId});});host.register('chat_upload', ({type}) => {if (type !== 'press') return;const channelId = host.currentChannelId;if (!channelId) return;- ComponentDispatch.dispatch('TEXTAREA_UPLOAD_FILE', {channelId});+ ComponentBus.dispatch('TEXTAREA_UPLOAD_FILE', {channelId});});host.register('system_zoom_in', ({type}) => {if (type !== 'press') return;diff --git a/fluxer_app/src/features/channel/components/ChannelAttachmentArea.tsx b/fluxer_app/src/features/channel/components/ChannelAttachmentArea.tsxindex 8d7f8a140..55e9fcc47 100644--- a/fluxer_app/src/features/channel/components/ChannelAttachmentArea.tsx+++ b/fluxer_app/src/features/channel/components/ChannelAttachmentArea.tsx@@ -15,7 +15,7 @@ import Messages from '@app/features/messaging/state/MessagingMessages';import {type CloudAttachment, CloudUpload} from '@app/features/messaging/upload/CloudUpload';import {isEmbeddableImageFile} from '@app/features/messaging/utils/EmbeddableImageTypes';import {formatFileSize} from '@app/features/messaging/utils/FileUtils';-import {ComponentDispatch} from '@app/features/platform/utils/ComponentBus';+import {ComponentBus} from '@app/features/platform/utils/ComponentBus';import * as MediaViewerCommands from '@app/features/ui/commands/MediaViewerCommands';import * as ModalCommands from '@app/features/ui/commands/ModalCommands';import {modal} from '@app/features/ui/commands/ModalCommands';@@ -629,7 +629,7 @@ export const ChannelAttachmentArea = observer(({channelId}: {channelId: string})forceJumpFrameRef.current = null;const messages = Messages.getMessages(channelIdRef.current);if (messages.hasMoreAfter) {- ComponentDispatch.dispatch('FORCE_JUMP_TO_PRESENT');+ ComponentBus.dispatch('FORCE_JUMP_TO_PRESENT');}});}, []);diff --git a/fluxer_app/src/features/channel/components/ChannelComposerDismissal.ts b/fluxer_app/src/features/channel/components/ChannelComposerDismissal.tsindex b32835518..333068aec 100644--- a/fluxer_app/src/features/channel/components/ChannelComposerDismissal.ts+++ b/fluxer_app/src/features/channel/components/ChannelComposerDismissal.ts@@ -1,13 +1,13 @@// SPDX-License-Identifier: AGPL-3.0-or-later-import {ComponentDispatch} from '@app/features/platform/utils/ComponentBus';+import {ComponentBus} from '@app/features/platform/utils/ComponentBus';export interface ChannelComposerDismissalRequest {channelId: string;}export function requestChannelComposerAffordanceDismissal(channelId: string): boolean {- const result = ComponentDispatch.dispatchToFirstResult(+ const result = ComponentBus.dispatchToFirstResult('TEXTAREA_DISMISS_AFFORDANCE',{channelId},(candidate) => candidate === true,diff --git a/fluxer_app/src/features/channel/components/ChannelHeader.tsx b/fluxer_app/src/features/channel/components/ChannelHeader.tsxindex 0cc941d9c..226883fb5 100644--- a/fluxer_app/src/features/channel/components/ChannelHeader.tsx+++ b/fluxer_app/src/features/channel/components/ChannelHeader.tsx@@ -78,7 +78,7 @@ import * as NavigationCommands from '@app/features/navigation/commands/Navigatioimport * as RouterUtils from '@app/features/navigation/utils/RouterUtils';import {goBackOr} from '@app/features/platform/components/router/NavigationAdapter';import {useLocation} from '@app/features/platform/components/router/RouterReact';-import {ComponentDispatch} from '@app/features/platform/utils/ComponentBus';+import {ComponentBus} from '@app/features/platform/utils/ComponentBus';import {AddFriendsToGroupModal} from '@app/features/relationship/components/modals/AddFriendsToGroupModal';import Relationships from '@app/features/relationship/state/Relationships';import type {SearchSegment} from '@app/features/search/utils/SearchSegmentManager';@@ -329,11 +329,11 @@ export const ChannelHeader = observer(setInitialTab(initialTab || 'members');setChannelDetailsOpen(true);};- return ComponentDispatch.subscribe('CHANNEL_DETAILS_OPEN', handleChannelDetailsOpen);+ return ComponentBus.subscribe('CHANNEL_DETAILS_OPEN', handleChannelDetailsOpen);}, []);useEffect(() => {if (!showMembersToggle) return;- return ComponentDispatch.subscribe('CHANNEL_MEMBER_LIST_TOGGLE', () => {+ return ComponentBus.subscribe('CHANNEL_MEMBER_LIST_TOGGLE', () => {if (canFitMemberList) {if (memberListUsesChannelOverride) {MemberList.toggleDefaultHiddenChannelMembers(memberListChannelId);diff --git a/fluxer_app/src/features/channel/components/ChannelMessages.tsx b/fluxer_app/src/features/channel/components/ChannelMessages.tsxindex 1373bb9a2..08e503ef7 100644--- a/fluxer_app/src/features/channel/components/ChannelMessages.tsx+++ b/fluxer_app/src/features/channel/components/ChannelMessages.tsx@@ -31,7 +31,7 @@ import {import LocalUserSpamOverride from '@app/features/moderation/state/LocalUserSpamOverride';import SelectedChannel from '@app/features/navigation/state/SelectedChannel';import Permission from '@app/features/permissions/state/Permission';-import {ComponentDispatch} from '@app/features/platform/utils/ComponentBus';+import {ComponentBus} from '@app/features/platform/utils/ComponentBus';import {useScrollManager} from '@app/features/platform/utils/ScrollManager';import * as ReadStateCommands from '@app/features/read_state/commands/ReadStateCommands';import ReadStates from '@app/features/read_state/state/ReadStates';@@ -400,14 +400,14 @@ export const Messages = observer(function Messages({}};const dispatchUnsubs = [- ComponentDispatch.subscribe('SCROLLTO_PRESENT', onScrollToPresent),- ComponentDispatch.subscribe('MESSAGE_SENT', onMessageSent),- ComponentDispatch.subscribe('FORCE_JUMP_TO_PRESENT', onForceJumpToPresent),- ComponentDispatch.subscribe('ESCAPE_PRESSED', onEscapePressed),- ComponentDispatch.subscribe('SCROLL_PAGE_UP', onScrollPageUp),- ComponentDispatch.subscribe('SCROLL_PAGE_DOWN', onScrollPageDown),- ComponentDispatch.subscribe('LAYOUT_RESIZED', onLayoutResized),- ComponentDispatch.subscribe('FOCUS_BOTTOMMOST_MESSAGE', onFocusBottommostMessage),+ ComponentBus.subscribe('SCROLL_TO_PRESENT', onScrollToPresent),+ ComponentBus.subscribe('MESSAGE_SENT', onMessageSent),+ ComponentBus.subscribe('FORCE_JUMP_TO_PRESENT', onForceJumpToPresent),+ ComponentBus.subscribe('ESCAPE_PRESSED', onEscapePressed),+ ComponentBus.subscribe('SCROLL_PAGE_UP', onScrollPageUp),+ ComponentBus.subscribe('SCROLL_PAGE_DOWN', onScrollPageDown),+ ComponentBus.subscribe('LAYOUT_RESIZED', onLayoutResized),+ ComponentBus.subscribe('FOCUS_BOTTOMMOST_MESSAGE', onFocusBottommostMessage),];updateFromState();return () => {@@ -477,7 +477,7 @@ export const Messages = observer(function Messages({return;}scrollManager.jumpCancel();- ComponentDispatch.dispatch('FOCUS_TEXTAREA', {channelId: channel.id});+ ComponentBus.dispatch('FOCUS_TEXTAREA', {channelId: channel.id});},allowWhenInactive: true,});diff --git a/fluxer_app/src/features/channel/components/ChannelStickersArea.tsx b/fluxer_app/src/features/channel/components/ChannelStickersArea.tsxindex b524c0fb7..049d68977 100644--- a/fluxer_app/src/features/channel/components/ChannelStickersArea.tsx+++ b/fluxer_app/src/features/channel/components/ChannelStickersArea.tsx@@ -4,7 +4,7 @@ import * as ChannelStickerCommands from '@app/features/channel/commands/ChannelSimport styles from '@app/features/channel/components/ChannelStickersArea.module.css';import ChannelSticker from '@app/features/channel/state/ChannelSticker';import {useStickerAnimation} from '@app/features/emoji/hooks/useStickerAnimation';-import {ComponentDispatch} from '@app/features/platform/utils/ComponentBus';+import {ComponentBus} from '@app/features/platform/utils/ComponentBus';import {StickerContextMenuItems} from '@app/features/ui/action_menu/items/StickerContextMenuItems';import * as ContextMenuCommands from '@app/features/ui/commands/ContextMenuCommands';import FocusRing from '@app/features/ui/focus_ring/FocusRing';@@ -36,9 +36,9 @@ export const ChannelStickersArea: React.FC<ChannelStickersAreaProps> = observer(const [previousSticker, setPreviousSticker] = useState(sticker);useEffect(() => {if (previousSticker && !sticker) {- ComponentDispatch.dispatch('FORCE_JUMP_TO_PRESENT');+ ComponentBus.dispatch('FORCE_JUMP_TO_PRESENT');} else if (!previousSticker && sticker) {- ComponentDispatch.dispatch('FORCE_JUMP_TO_PRESENT');+ ComponentBus.dispatch('FORCE_JUMP_TO_PRESENT');}setPreviousSticker(sticker);}, [sticker, previousSticker]);diff --git a/fluxer_app/src/features/channel/components/EditingMessageInput.tsx b/fluxer_app/src/features/channel/components/EditingMessageInput.tsxindex eda3c9610..982084059 100644--- a/fluxer_app/src/features/channel/components/EditingMessageInput.tsx+++ b/fluxer_app/src/features/channel/components/EditingMessageInput.tsx@@ -23,7 +23,7 @@ import MessageEdit from '@app/features/messaging/state/MessageEdit';import {applyMarkdownSegments} from '@app/features/messaging/utils/MarkdownToSegmentUtils';import type {MentionSegment} from '@app/features/messaging/utils/TextareaSegmentManager';import {TextareaSegmentManager} from '@app/features/messaging/utils/TextareaSegmentManager';-import {ComponentDispatch} from '@app/features/platform/utils/ComponentBus';+import {ComponentBus} from '@app/features/platform/utils/ComponentBus';import * as PopoutCommands from '@app/features/ui/commands/PopoutCommands';import FocusRing from '@app/features/ui/focus_ring/FocusRing';import {openPopout} from '@app/features/ui/popover/PopoverPopout';@@ -187,7 +187,7 @@ export const EditingMessageInput = observer(setExpressionPickerOpen(false);}, [channel.id, editingDisabled]);useEffect(() => {- const unsubscribe = ComponentDispatch.subscribe('FOCUS_TEXTAREA', (payload?: unknown) => {+ const unsubscribe = ComponentBus.subscribe('FOCUS_TEXTAREA', (payload?: unknown) => {const data = payload as {channelId?: string; enterKeyboardMode?: boolean} | undefined;let requestedChannelId: string | null = null;let enterKeyboardMode: boolean | null = null;@@ -247,7 +247,7 @@ export const EditingMessageInput = observer();}, [channel.id, editingDisabled, expressionPickerOpen, handleEmojiSelect]);useEffect(() => {- const unsubscribe = ComponentDispatch.subscribe('EDITING_EXPRESSION_PICKER_TAB_TOGGLE', (payload?: unknown) => {+ const unsubscribe = ComponentBus.subscribe('EDITING_EXPRESSION_PICKER_TAB_TOGGLE', (payload?: unknown) => {const data = payload as {channelId?: string; messageId?: string; tab?: string} | undefined;if (data == null || data.channelId !== channel.id || data.messageId !== message.id || data.tab !== 'emojis') {return;diff --git a/fluxer_app/src/features/channel/components/EmojiPicker.tsx b/fluxer_app/src/features/channel/components/EmojiPicker.tsxindex 38ab71e7e..436de0538 100644--- a/fluxer_app/src/features/channel/components/EmojiPicker.tsx+++ b/fluxer_app/src/features/channel/components/EmojiPicker.tsx@@ -28,7 +28,7 @@ import {} from '@app/features/expressions/utils/ExpressionPermissionUtils';import {getEmojiDisplayDataWithSkinTone} from '@app/features/expressions/utils/SkinToneUtils';import Permission from '@app/features/permissions/state/Permission';-import {ComponentDispatch} from '@app/features/platform/utils/ComponentBus';+import {ComponentBus} from '@app/features/platform/utils/ComponentBus';import {usePremiumUpsellData} from '@app/features/premium/hooks/usePremiumUpsellData';import {shouldShowPremiumFeatures} from '@app/features/premium/utils/PremiumUtils';import {Scroller, type ScrollerHandle} from '@app/features/ui/components/Scroller';@@ -113,7 +113,7 @@ export const EmojiPicker = observer(const handleEmojiDataUpdated = () => {setEmojiDataVersion((version) => version + 1);};- return ComponentDispatch.subscribe('EMOJI_PICKER_RERENDER', handleEmojiDataUpdated);+ return ComponentBus.subscribe('EMOJI_PICKER_RERENDER', handleEmojiDataUpdated);}, []);useSearchInputAutofocus(searchInputRef);const searchItems = useMemo(diff --git a/fluxer_app/src/features/channel/components/GiftEmbed.tsx b/fluxer_app/src/features/channel/components/GiftEmbed.tsxindex 43547a331..8cfa9685c 100644--- a/fluxer_app/src/features/channel/components/GiftEmbed.tsx+++ b/fluxer_app/src/features/channel/components/GiftEmbed.tsx@@ -15,7 +15,7 @@ import {import cardStyles from '@app/features/messaging/components/embeds/embed_card/EmbedCard.module.css';import {useEmbedSkeletonOverride} from '@app/features/messaging/components/embeds/embed_card/useEmbedSkeletonOverride';import {Logger} from '@app/features/platform/utils/AppLogger';-import {ComponentDispatch} from '@app/features/platform/utils/ComponentBus';+import {ComponentBus} from '@app/features/platform/utils/ComponentBus';import {Button} from '@app/features/ui/button/Button';import Users from '@app/features/user/state/Users';import * as NicknameUtils from '@app/features/user/utils/NicknameUtils';@@ -87,7 +87,7 @@ export const GiftEmbed = observer(function GiftEmbed({code}: GiftEmbedProps) {useEffect(() => {const isLoading = !!giftState?.loading;if (prevLoadingRef.current && !isLoading && giftState) {- ComponentDispatch.dispatch('LAYOUT_RESIZED');+ ComponentBus.dispatch('LAYOUT_RESIZED');}prevLoadingRef.current = isLoading;}, [giftState?.loading]);diff --git a/fluxer_app/src/features/channel/components/InviteEmbed.tsx b/fluxer_app/src/features/channel/components/InviteEmbed.tsxindex 06bd04c29..c52938a39 100644--- a/fluxer_app/src/features/channel/components/InviteEmbed.tsx+++ b/fluxer_app/src/features/channel/components/InviteEmbed.tsx@@ -49,7 +49,7 @@ import cardStyles from '@app/features/messaging/components/embeds/embed_card/Embimport {useEmbedSkeletonOverride} from '@app/features/messaging/components/embeds/embed_card/useEmbedSkeletonOverride';import type {Message} from '@app/features/messaging/models/MessagingMessage';import * as RouterUtils from '@app/features/navigation/utils/RouterUtils';-import {ComponentDispatch} from '@app/features/platform/utils/ComponentBus';+import {ComponentBus} from '@app/features/platform/utils/ComponentBus';import StreamerMode from '@app/features/streamer_mode/state/StreamerMode';import {InviteEmbedContextMenu} from '@app/features/ui/action_menu/InviteEmbedContextMenu';import {Button} from '@app/features/ui/button/Button';@@ -210,7 +210,7 @@ const InviteEmbedInner = observer(function InviteEmbedInner({}, [code]);useEffect(() => {if (prevLoadingRef.current && !isLoading && currentChannelId) {- ComponentDispatch.dispatch('LAYOUT_RESIZED', {channelId: currentChannelId});+ ComponentBus.dispatch('LAYOUT_RESIZED', {channelId: currentChannelId});}prevLoadingRef.current = isLoading;}, [isLoading, currentChannelId]);diff --git a/fluxer_app/src/features/channel/components/LexicalChannelTextareaContent.tsx b/fluxer_app/src/features/channel/components/LexicalChannelTextareaContent.tsxindex 8ddf7ea2b..2de16c2ac 100644--- a/fluxer_app/src/features/channel/components/LexicalChannelTextareaContent.tsx+++ b/fluxer_app/src/features/channel/components/LexicalChannelTextareaContent.tsx@@ -97,7 +97,7 @@ import {resolveTypedEmojiShortcodes,resolveTypedEmojiToken,} from '@app/features/messaging/utils/TypedEmojiShortcodeUtils';-import {ComponentDispatch} from '@app/features/platform/utils/ComponentBus';+import {ComponentBus} from '@app/features/platform/utils/ComponentBus';import {useSlowmode} from '@app/features/slowmode/hooks/useSlowmode';import * as ContextMenuCommands from '@app/features/ui/commands/ContextMenuCommands';import * as ModalCommands from '@app/features/ui/commands/ModalCommands';@@ -689,7 +689,7 @@ export const LexicalChannelTextareaContent = observer(wasAtBottomBeforeComposerBoundaryChange.current &&(stickerBoundaryChanged || (attachmentBoundaryChanged && Messages.getMessages(channel.id).hasMoreAfter))) {- ComponentDispatch.dispatch('FORCE_JUMP_TO_PRESENT', {channelId: channel.id});+ ComponentBus.dispatch('FORCE_JUMP_TO_PRESENT', {channelId: channel.id});}previousComposerBoundaryState.current = {channelId: channel.id, hasAttachments, hasPendingSticker};const scrollerElement = getActiveMessageScroller();@@ -789,7 +789,7 @@ export const LexicalChannelTextareaContent = observer(replyingMessage,]);useEffect(() => {- return ComponentDispatch.subscribe('TEXTAREA_DISMISS_AFFORDANCE', (request?: unknown) => {+ return ComponentBus.subscribe('TEXTAREA_DISMISS_AFFORDANCE', (request?: unknown) => {const dismissalRequest = request as ChannelComposerDismissalRequest | undefined;if (dismissalRequest?.channelId !== channel.id) {return false;@@ -863,7 +863,7 @@ export const LexicalChannelTextareaContent = observer(}, [canSubmit, channel, hasAttachments, onSubmit]);const handleArrowUpEmpty = useCallback(() => {if (KeyboardMode.keyboardModeEnabled) {- ComponentDispatch.dispatch('FOCUS_BOTTOMMOST_MESSAGE', {channelId: channel.id});+ ComponentBus.dispatch('FOCUS_BOTTOMMOST_MESSAGE', {channelId: channel.id});return;}const message = Messages.getLastEditableMessage(channel.id);@@ -909,7 +909,7 @@ export const LexicalChannelTextareaContent = observer(Number.MAX_SAFE_INTEGER,);useEffect(() => {- const unsubscribe = ComponentDispatch.subscribe('FOCUS_TEXTAREA', (payload?: unknown) => {+ const unsubscribe = ComponentBus.subscribe('FOCUS_TEXTAREA', (payload?: unknown) => {const payloadValue = payload === null || payload === undefined ? {} : payload;const {channelId, enterKeyboardMode} = payloadValue as {channelId?: string;@@ -944,7 +944,7 @@ export const LexicalChannelTextareaContent = observer(}, [editingMessageId, mobileLayout.enabled, textareaInputDisabled]);useEffect(() => {if (textareaInputDisabled) return;- const unsubscribe = ComponentDispatch.subscribe('TEXTAREA_UPLOAD_FILE', (payload?: unknown) => {+ const unsubscribe = ComponentBus.subscribe('TEXTAREA_UPLOAD_FILE', (payload?: unknown) => {const payloadValue = payload === null || payload === undefined ? {} : payload;const {channelId} = payloadValue as {channelId?: string};if (channelId && channelId !== channel.id) return;@@ -953,7 +953,7 @@ export const LexicalChannelTextareaContent = observer(return unsubscribe;}, [channel.id, textareaInputDisabled, handleFileButtonClick]);useEffect(() => {- const unsubscribe = ComponentDispatch.subscribe('TEXTAREA_SEND_VOICE_MESSAGE', (payload?: unknown) => {+ const unsubscribe = ComponentBus.subscribe('TEXTAREA_SEND_VOICE_MESSAGE', (payload?: unknown) => {const payloadValue = payload === null || payload === undefined ? {} : payload;const {channelId} = payloadValue as {channelId?: string};if (channelId && channelId !== channel.id) return undefined;diff --git a/fluxer_app/src/features/channel/components/MessageActionBar.tsx b/fluxer_app/src/features/channel/components/MessageActionBar.tsxindex 2ce1dffcb..36d2ec10e 100644--- a/fluxer_app/src/features/channel/components/MessageActionBar.tsx+++ b/fluxer_app/src/features/channel/components/MessageActionBar.tsx@@ -38,7 +38,7 @@ import {import type {Message} from '@app/features/messaging/models/MessagingMessage';import SavedMessages from '@app/features/messaging/state/SavedMessages';import {getEmojiNameWithColons, toReactionEmoji} from '@app/features/messaging/utils/ReactionUtils';-import {ComponentDispatch} from '@app/features/platform/utils/ComponentBus';+import {ComponentBus} from '@app/features/platform/utils/ComponentBus';import messageStyles from '@app/features/theme/styles/Message.module.css';import {AddReactionIcon,@@ -438,7 +438,7 @@ export const MessageActionBarCore: React.FC<MessageActionBarCoreProps> = observe);}, [message, i18n]);useEffect(() => {- const unsubscribe = ComponentDispatch.subscribe('EMOJI_PICKER_OPEN', (payload?: unknown) => {+ const unsubscribe = ComponentBus.subscribe('EMOJI_PICKER_OPEN', (payload?: unknown) => {const data = (payload ?? {}) as {messageId?: string};if (data.messageId === message.id && emojiPickerButtonRef.current) {PopoutCommands.open({diff --git a/fluxer_app/src/features/channel/components/MessageActionUtils.tsx b/fluxer_app/src/features/channel/components/MessageActionUtils.tsxindex b95f2b596..485fb4bbf 100644--- a/fluxer_app/src/features/channel/components/MessageActionUtils.tsx+++ b/fluxer_app/src/features/channel/components/MessageActionUtils.tsx@@ -24,7 +24,7 @@ import {retryFailedMessage} from '@app/features/messaging/utils/MessageRetryUtilimport {type ReactionEmoji, toReactionEmoji} from '@app/features/messaging/utils/ReactionUtils';import {getDefaultReplyMention} from '@app/features/notification/utils/MentionReplyPreferenceUtils';import Permission from '@app/features/permissions/state/Permission';-import {ComponentDispatch} from '@app/features/platform/utils/ComponentBus';+import {ComponentBus} from '@app/features/platform/utils/ComponentBus';import * as ReadStateCommands from '@app/features/read_state/commands/ReadStateCommands';import Relationships from '@app/features/relationship/state/Relationships';import * as ModalCommands from '@app/features/ui/commands/ModalCommands';@@ -128,7 +128,7 @@ export function canDeleteAttachmentUtil(message: Message | undefined): boolean {}export function requestOpenReactionPicker(messageId: string): void {- ComponentDispatch.dispatch('EMOJI_PICKER_OPEN', {messageId});+ ComponentBus.dispatch('EMOJI_PICKER_OPEN', {messageId});}function messageElementSelector(messageId: string): string {@@ -145,14 +145,14 @@ export function triggerAddReaction(message: Message): boolean {}const messageElement = document.querySelector<HTMLElement>(messageElementSelector(message.id));if (!messageElement) {- ComponentDispatch.dispatch('EMOJI_PICKER_OPEN', {messageId: message.id});+ ComponentBus.dispatch('EMOJI_PICKER_OPEN', {messageId: message.id});return false;}const addReactionButton = messageElement.querySelector<HTMLButtonElement>('[data-action="message-add-reaction-button"]',);if (!addReactionButton) {- ComponentDispatch.dispatch('EMOJI_PICKER_OPEN', {messageId: message.id});+ ComponentBus.dispatch('EMOJI_PICKER_OPEN', {messageId: message.id});return false;}addReactionButton.click();diff --git a/fluxer_app/src/features/channel/components/MobileEmojiPicker.tsx b/fluxer_app/src/features/channel/components/MobileEmojiPicker.tsxindex eade67973..7476ffa5e 100644--- a/fluxer_app/src/features/channel/components/MobileEmojiPicker.tsx+++ b/fluxer_app/src/features/channel/components/MobileEmojiPicker.tsx@@ -27,7 +27,7 @@ import {} from '@app/features/expressions/utils/ExpressionPermissionUtils';import {getEmojiDisplayDataWithSkinTone} from '@app/features/expressions/utils/SkinToneUtils';import Permission from '@app/features/permissions/state/Permission';-import {ComponentDispatch} from '@app/features/platform/utils/ComponentBus';+import {ComponentBus} from '@app/features/platform/utils/ComponentBus';import {usePremiumUpsellData} from '@app/features/premium/hooks/usePremiumUpsellData';import {shouldShowPremiumFeatures} from '@app/features/premium/utils/PremiumUtils';import {Scroller, type ScrollerHandle} from '@app/features/ui/components/Scroller';@@ -86,7 +86,7 @@ export const MobileEmojiPicker = observer(const handleEmojiDataUpdated = () => {setEmojiDataVersion((version) => version + 1);};- return ComponentDispatch.subscribe('EMOJI_PICKER_RERENDER', handleEmojiDataUpdated);+ return ComponentBus.subscribe('EMOJI_PICKER_RERENDER', handleEmojiDataUpdated);}, []);useEffect(() => {const updateVisibleViewportWidth = () => {diff --git a/fluxer_app/src/features/channel/components/MobileMemesPicker.tsx b/fluxer_app/src/features/channel/components/MobileMemesPicker.tsxindex 5f7525194..fa75a0ac5 100644--- a/fluxer_app/src/features/channel/components/MobileMemesPicker.tsx+++ b/fluxer_app/src/features/channel/components/MobileMemesPicker.tsx@@ -19,7 +19,7 @@ import type {FavoriteMeme} from '@app/features/expressions/models/FavoriteMeme';import FavoriteMemes from '@app/features/expressions/state/FavoriteMemes';import {AUDIO_DESCRIPTOR, GIFS_DESCRIPTOR} from '@app/features/i18n/utils/CommonMessageDescriptors';import {isKeyboardActivationKey} from '@app/features/input/utils/KeyboardUtils';-import {ComponentDispatch} from '@app/features/platform/utils/ComponentBus';+import {ComponentBus} from '@app/features/platform/utils/ComponentBus';import {DeleteIcon, EditIcon} from '@app/features/ui/action_menu/ContextMenuIcons';import * as ModalCommands from '@app/features/ui/commands/ModalCommands';import {modal} from '@app/features/ui/commands/ModalCommands';@@ -269,7 +269,7 @@ export const MobileMemesPicker = observer(({onClose}: MobileMemesPickerProps = {memeRecord: meme,onClick: (event?: React.MouseEvent) => {const shiftKey = event?.shiftKey ?? false;- ComponentDispatch.dispatch('FAVORITE_MEME_SELECT', {meme, autoSend: !shiftKey});+ ComponentBus.dispatch('FAVORITE_MEME_SELECT', {meme, autoSend: !shiftKey});if (!shiftKey) {onClose?.();}diff --git a/fluxer_app/src/features/channel/components/MobileStickersPicker.tsx b/fluxer_app/src/features/channel/components/MobileStickersPicker.tsxindex 5b254efa5..1a29704cb 100644--- a/fluxer_app/src/features/channel/components/MobileStickersPicker.tsx+++ b/fluxer_app/src/features/channel/components/MobileStickersPicker.tsx@@ -30,7 +30,7 @@ import {shouldShowStickerPremiumUpsell,} from '@app/features/expressions/utils/ExpressionPermissionUtils';import Permission from '@app/features/permissions/state/Permission';-import {ComponentDispatch} from '@app/features/platform/utils/ComponentBus';+import {ComponentBus} from '@app/features/platform/utils/ComponentBus';import {usePremiumUpsellData} from '@app/features/premium/hooks/usePremiumUpsellData';import {shouldShowPremiumFeatures} from '@app/features/premium/utils/PremiumUtils';import {Scroller, type ScrollerHandle} from '@app/features/ui/components/Scroller';@@ -109,7 +109,7 @@ export const MobileStickersPicker = observer(const handleStickerDataUpdated = () => {setStickerDataVersion((version) => version + 1);};- return ComponentDispatch.subscribe('STICKER_PICKER_RERENDER', handleStickerDataUpdated);+ return ComponentBus.subscribe('STICKER_PICKER_RERENDER', handleStickerDataUpdated);}, []);useSearchInputAutofocus(searchInputRef);const searchItems = useMemo(diff --git a/fluxer_app/src/features/channel/components/PinSystemMessage.tsx b/fluxer_app/src/features/channel/components/PinSystemMessage.tsxindex a1c0d7eff..3b00331dd 100644--- a/fluxer_app/src/features/channel/components/PinSystemMessage.tsx+++ b/fluxer_app/src/features/channel/components/PinSystemMessage.tsx@@ -5,7 +5,7 @@ import {SystemMessageUsername} from '@app/features/channel/components/SystemMessimport {useSystemMessageData} from '@app/features/messaging/hooks/useSystemMessageData';import type {Message} from '@app/features/messaging/models/MessagingMessage';import {goToMessage} from '@app/features/messaging/utils/MessageNavigator';-import {ComponentDispatch} from '@app/features/platform/utils/ComponentBus';+import {ComponentBus} from '@app/features/platform/utils/ComponentBus';import styles from '@app/features/theme/styles/Message.module.css';import MobileLayout from '@app/features/ui/state/MobileLayout';import {Trans} from '@lingui/react/macro';@@ -30,11 +30,11 @@ export const PinSystemMessage = observer(({message}: PinSystemMessageProps) => {}, [message.channelId, message.id, message.messageReference?.message_id]);const openPins = useCallback(() => {if (mobileLayout.enabled) {- ComponentDispatch.dispatch('CHANNEL_DETAILS_OPEN', {+ ComponentBus.dispatch('CHANNEL_DETAILS_OPEN', {initialTab: 'pins',});} else {- ComponentDispatch.dispatch('CHANNEL_PINS_OPEN');+ ComponentBus.dispatch('CHANNEL_PINS_OPEN');}}, [mobileLayout.enabled]);if (!channel) {diff --git a/fluxer_app/src/features/channel/components/PreloadableUserPopout.tsx b/fluxer_app/src/features/channel/components/PreloadableUserPopout.tsxindex 7f0c48032..49900ef36 100644--- a/fluxer_app/src/features/channel/components/PreloadableUserPopout.tsx+++ b/fluxer_app/src/features/channel/components/PreloadableUserPopout.tsx@@ -6,7 +6,7 @@ import {GuildMemberActionsSheet} from '@app/features/guild/components/modals/guiimport type {GuildMember} from '@app/features/member/models/GuildMember';import GuildMembers from '@app/features/member/state/GuildMembers';import type {Message} from '@app/features/messaging/models/MessagingMessage';-import {ComponentDispatch} from '@app/features/platform/utils/ComponentBus';+import {ComponentBus} from '@app/features/platform/utils/ComponentBus';import {GuildMemberContextMenu} from '@app/features/ui/action_menu/GuildMemberContextMenu';import {UserContextMenu} from '@app/features/ui/action_menu/UserContextMenu';import {WebhookContextMenu} from '@app/features/ui/action_menu/WebhookContextMenu';@@ -155,7 +155,7 @@ export const PreloadableUserPopout = React.forwardRef<if (isShiftMentionClick(event)) {event.preventDefault();event.stopPropagation();- ComponentDispatch.dispatch('INSERT_MENTION', {userId: user.id});+ ComponentBus.dispatch('INSERT_MENTION', {userId: user.id});return;}handleMobileClick();@@ -217,7 +217,7 @@ export const PreloadableUserPopout = React.forwardRef<if (isShiftMentionClick(event)) {event.preventDefault();event.stopPropagation();- ComponentDispatch.dispatch('INSERT_MENTION', {userId: user.id});+ ComponentBus.dispatch('INSERT_MENTION', {userId: user.id});return;}if (originalOnClick) {diff --git a/fluxer_app/src/features/channel/components/StickersPicker.tsx b/fluxer_app/src/features/channel/components/StickersPicker.tsxindex 0e80afca1..c19fa248f 100644--- a/fluxer_app/src/features/channel/components/StickersPicker.tsx+++ b/fluxer_app/src/features/channel/components/StickersPicker.tsx@@ -25,7 +25,7 @@ import {shouldShowStickerPremiumUpsell,} from '@app/features/expressions/utils/ExpressionPermissionUtils';import Permission from '@app/features/permissions/state/Permission';-import {ComponentDispatch} from '@app/features/platform/utils/ComponentBus';+import {ComponentBus} from '@app/features/platform/utils/ComponentBus';import {usePremiumUpsellData} from '@app/features/premium/hooks/usePremiumUpsellData';import {shouldShowPremiumFeatures} from '@app/features/premium/utils/PremiumUtils';import {Scroller, type ScrollerHandle} from '@app/features/ui/components/Scroller';@@ -101,7 +101,7 @@ export const StickersPicker = observer(const handleStickerDataUpdated = () => {setStickerDataVersion((version) => version + 1);};- return ComponentDispatch.subscribe('STICKER_PICKER_RERENDER', handleStickerDataUpdated);+ return ComponentBus.subscribe('STICKER_PICKER_RERENDER', handleStickerDataUpdated);}, []);useSearchInputAutofocus(searchInputRef);const searchItems = useMemo(diff --git a/fluxer_app/src/features/channel/components/UploadManager.tsx b/fluxer_app/src/features/channel/components/UploadManager.tsxindex 3ece2ce88..fd711bda1 100644--- a/fluxer_app/src/features/channel/components/UploadManager.tsx+++ b/fluxer_app/src/features/channel/components/UploadManager.tsx@@ -12,7 +12,7 @@ import MessageQueue from '@app/features/messaging/state/MessageQueue';import {CloudUpload} from '@app/features/messaging/upload/CloudUpload';import {isDialogPasteTarget} from '@app/features/messaging/utils/TextInputEditUtils';import {formatUploadingAttachmentSummary} from '@app/features/messaging/utils/UploadingAttachmentLabelUtils';-import {ComponentDispatch} from '@app/features/platform/utils/ComponentBus';+import {ComponentBus} from '@app/features/platform/utils/ComponentBus';import {useSlowmode} from '@app/features/slowmode/hooks/useSlowmode';import * as ModalCommands from '@app/features/ui/commands/ModalCommands';import {modal} from '@app/features/ui/commands/ModalCommands';@@ -50,7 +50,7 @@ export const UploadManager = observer(({channel, canAttachFiles, canSendMessages}, []);const focusTextarea = useCallback(() => {setTimeout(() => {- ComponentDispatch.dispatch('FOCUS_TEXTAREA', {channelId: channel.id});+ ComponentBus.dispatch('FOCUS_TEXTAREA', {channelId: channel.id});}, 0);}, [channel.id]);const onDrop = useCallback(diff --git a/fluxer_app/src/features/channel/components/channel_view/DMChannelView.tsx b/fluxer_app/src/features/channel/components/channel_view/DMChannelView.tsxindex 031aaa495..4ac928016 100644--- a/fluxer_app/src/features/channel/components/channel_view/DMChannelView.tsx+++ b/fluxer_app/src/features/channel/components/channel_view/DMChannelView.tsx@@ -39,7 +39,7 @@ import Channels from '@app/features/channel/state/Channels';import * as ChannelUtils from '@app/features/channel/utils/ChannelUtils';import {INCOMING_CALL_DESCRIPTOR} from '@app/features/i18n/utils/CommonMessageDescriptors';import {useMemberListVisible} from '@app/features/member/hooks/useMemberListVisible';-import {ComponentDispatch} from '@app/features/platform/utils/ComponentBus';+import {ComponentBus} from '@app/features/platform/utils/ComponentBus';import ReadStates from '@app/features/read_state/state/ReadStates';import Relationships from '@app/features/relationship/state/Relationships';import {remFromPx} from '@app/features/theme/layout/RemFromPx';@@ -160,7 +160,7 @@ export const DMChannelView = observer(({channelId}: DMChannelViewProps) => {});useEffect(() => {if (!showCompactVoiceView || !currentChannelId) return;- return ComponentDispatch.subscribe('COMPACT_VOICE_CALL_EXPANSION_TOGGLE', (payload?: unknown) => {+ return ComponentBus.subscribe('COMPACT_VOICE_CALL_EXPANSION_TOGGLE', (payload?: unknown) => {const {channelId: targetChannelId} = (payload ?? {}) as {channelId?: string};if (targetChannelId && targetChannelId !== currentChannelId) return false;handleToggleCompactCallExpanded();diff --git a/fluxer_app/src/features/channel/components/channel_view/GuildChannelView.tsx b/fluxer_app/src/features/channel/components/channel_view/GuildChannelView.tsxindex a145b2953..820d887c1 100644--- a/fluxer_app/src/features/channel/components/channel_view/GuildChannelView.tsx+++ b/fluxer_app/src/features/channel/components/channel_view/GuildChannelView.tsx@@ -33,7 +33,7 @@ import Guilds from '@app/features/guild/state/Guilds';import GuildVerification from '@app/features/guild/state/GuildVerification';import {useMemberListVisible} from '@app/features/member/hooks/useMemberListVisible';import Permission from '@app/features/permissions/state/Permission';-import {ComponentDispatch} from '@app/features/platform/utils/ComponentBus';+import {ComponentBus} from '@app/features/platform/utils/ComponentBus';import ReadStates from '@app/features/read_state/state/ReadStates';import {Button} from '@app/features/ui/button/Button';import MobileLayout from '@app/features/ui/state/MobileLayout';@@ -255,7 +255,7 @@ export const GuildChannelView = observer(({channelId, guildId}: GuildChannelView}, [handleOpenVoiceCallFromTextChat, handleOpenVoiceTextChat, isVoiceTextCallExpanded]);useEffect(() => {if (!isVoiceChannel) return;- return ComponentDispatch.subscribe('COMPACT_VOICE_CALL_EXPANSION_TOGGLE', (payload?: unknown) => {+ return ComponentBus.subscribe('COMPACT_VOICE_CALL_EXPANSION_TOGGLE', (payload?: unknown) => {const {channelId: targetChannelId} = (payload ?? {}) as {channelId?: string};if (targetChannelId && targetChannelId !== channelId) return false;handleToggleVoiceTextCallExpanded();diff --git a/fluxer_app/src/features/channel/components/emoji_picker/SkinToneSelector.tsx b/fluxer_app/src/features/channel/components/emoji_picker/SkinToneSelector.tsxindex e9eb21eee..f0c72f120 100644--- a/fluxer_app/src/features/channel/components/emoji_picker/SkinToneSelector.tsx+++ b/fluxer_app/src/features/channel/components/emoji_picker/SkinToneSelector.tsx@@ -6,7 +6,7 @@ import {EMOJI_CLAP} from '@app/features/channel/components/emoji_picker/EmojiPicimport * as EmojiCommands from '@app/features/emoji/commands/EmojiCommands';import Emoji from '@app/features/emoji/state/Emoji';import * as EmojiUtils from '@app/features/expressions/utils/EmojiUtils';-import {ComponentDispatch} from '@app/features/platform/utils/ComponentBus';+import {ComponentBus} from '@app/features/platform/utils/ComponentBus';import {SKIN_TONE_SURROGATES} from '@fluxer/constants/src/EmojiConstants';import {AnimatePresence, motion} from 'framer-motion';import {observer} from 'mobx-react-lite';@@ -22,7 +22,7 @@ const SkinTonePicker = observer(({isOpen, onClose, skinTone}: SkinTonePickerPropconst prefersReducedMotion = Accessibility.useReducedMotion;const handleSelect = (surrogate: string) => {EmojiCommands.setSkinTone(surrogate);- ComponentDispatch.dispatch('EMOJI_PICKER_RERENDER');+ ComponentBus.dispatch('EMOJI_PICKER_RERENDER');onClose();};return (diff --git a/fluxer_app/src/features/channel/components/message_search_bar/useMessageSearchAutocomplete.ts b/fluxer_app/src/features/channel/components/message_search_bar/useMessageSearchAutocomplete.tsindex bd8a8b3ab..035eadead 100644--- a/fluxer_app/src/features/channel/components/message_search_bar/useMessageSearchAutocomplete.ts+++ b/fluxer_app/src/features/channel/components/message_search_bar/useMessageSearchAutocomplete.ts@@ -24,7 +24,7 @@ import type {LexicalSearchInputHandle} from '@app/features/lexical/search/Lexicaimport MemberSearch, {type SearchContext} from '@app/features/member/state/MemberSearch';import {isIMEComposing} from '@app/features/messaging/utils/IMECompositionUtils';import SelectedChannel from '@app/features/navigation/state/SelectedChannel';-import {ComponentDispatch} from '@app/features/platform/utils/ComponentBus';+import {ComponentBus} from '@app/features/platform/utils/ComponentBus';import SearchHistory, {type SearchHistoryEntry} from '@app/features/search/state/SearchHistory';import {buildSearchSegmentsFromHints,@@ -213,7 +213,7 @@ export function useMessageSearchAutocomplete({}}, [channel?.id, channel?.name, contextId, isInGuildChannel, onChange, value]);useEffect(() => {- return ComponentDispatch.subscribe('MESSAGE_SEARCH_OPEN', () => {+ return ComponentBus.subscribe('MESSAGE_SEARCH_OPEN', () => {openSearchInput();});}, [openSearchInput]);diff --git a/fluxer_app/src/features/channel/components/pickers/gif/GifPickerGridItem.tsx b/fluxer_app/src/features/channel/components/pickers/gif/GifPickerGridItem.tsxindex e127bf212..12bab2344 100644--- a/fluxer_app/src/features/channel/components/pickers/gif/GifPickerGridItem.tsx+++ b/fluxer_app/src/features/channel/components/pickers/gif/GifPickerGridItem.tsx@@ -22,7 +22,7 @@ import {REMOVE_FROM_FAVORITES_DESCRIPTOR,} from '@app/features/i18n/utils/CommonMessageDescriptors';import {isKeyboardActivationKey} from '@app/features/input/utils/KeyboardUtils';-import {ComponentDispatch} from '@app/features/platform/utils/ComponentBus';+import {ComponentBus} from '@app/features/platform/utils/ComponentBus';import {remFromPx} from '@app/features/theme/layout/RemFromPx';import {modal, push} from '@app/features/ui/commands/ModalCommands';import FocusRing from '@app/features/ui/focus_ring/FocusRing';@@ -173,7 +173,7 @@ export const GifPickerGridItem = observer(function GifPickerGridItem({return;}if (gif.favoriteGifLookup) {- ComponentDispatch.dispatch('GIF_SELECT', {+ ComponentBus.dispatch('GIF_SELECT', {gif,autoSend: autoSendKlipyGifs && !shiftKey,});@@ -184,7 +184,7 @@ export const GifPickerGridItem = observer(function GifPickerGridItem({if (!shareId) return;GifCommands.registerShare(shareId, searchTerm);const shareUrl = GifSlugUtils.resolveShareUrl(provider, {url: gif.url, slug: shareId});- ComponentDispatch.dispatch('GIF_SELECT', {+ ComponentBus.dispatch('GIF_SELECT', {gif: {...gif,id: shareId,diff --git a/fluxer_app/src/features/channel/components/pickers/memes/MemeGridItem.tsx b/fluxer_app/src/features/channel/components/pickers/memes/MemeGridItem.tsxindex bf689efd7..2e12578e9 100644--- a/fluxer_app/src/features/channel/components/pickers/memes/MemeGridItem.tsx+++ b/fluxer_app/src/features/channel/components/pickers/memes/MemeGridItem.tsx@@ -14,7 +14,7 @@ import {EditFavoriteMemeModal} from '@app/features/expressions/components/modalsimport type {FavoriteMeme} from '@app/features/expressions/models/FavoriteMeme';import {isKeyboardActivationKey} from '@app/features/input/utils/KeyboardUtils';import {buildMediaProxyURL, buildStaticGifPreviewURL} from '@app/features/messaging/utils/MediaProxyUtils';-import {ComponentDispatch} from '@app/features/platform/utils/ComponentBus';+import {ComponentBus} from '@app/features/platform/utils/ComponentBus';import * as ModalCommands from '@app/features/ui/commands/ModalCommands';import {modal} from '@app/features/ui/commands/ModalCommands';import FocusRing from '@app/features/ui/focus_ring/FocusRing';@@ -157,7 +157,7 @@ export const MemeGridItem = observer(const handleClick = (event: React.MouseEvent<HTMLDivElement> | React.KeyboardEvent<HTMLDivElement>) => {const shiftKey = 'shiftKey' in event ? event.shiftKey : false;MemesPicker.trackMemeUsage(meme.id);- ComponentDispatch.dispatch('FAVORITE_MEME_SELECT', {meme, autoSend: !shiftKey});+ ComponentBus.dispatch('FAVORITE_MEME_SELECT', {meme, autoSend: !shiftKey});if (!shiftKey) onClose?.();};const handleEdit = (event: React.MouseEvent) => {diff --git a/fluxer_app/src/features/channel/components/useChannelComposerGlobalShortcuts.ts b/fluxer_app/src/features/channel/components/useChannelComposerGlobalShortcuts.tsindex 882a5b357..0c598faef 100644--- a/fluxer_app/src/features/channel/components/useChannelComposerGlobalShortcuts.ts+++ b/fluxer_app/src/features/channel/components/useChannelComposerGlobalShortcuts.ts@@ -4,7 +4,7 @@ import {requestChannelComposerAffordanceDismissal} from '@app/features/channel/cimport type {Channel} from '@app/features/channel/models/Channel';import type {ComposerHandle} from '@app/features/lexical/composer/ComposerHandle';import MessageFocus from '@app/features/messaging/state/MessageFocus';-import {ComponentDispatch} from '@app/features/platform/utils/ComponentBus';+import {ComponentBus} from '@app/features/platform/utils/ComponentBus';import {canFocusTextarea, safeFocus} from '@app/features/platform/utils/InputFocusManager';import {isTextInputKeyEvent} from '@app/features/platform/utils/IsTextInputKeyEvent';import QuickSwitcher from '@app/features/search/state/QuickSwitcher';@@ -98,7 +98,7 @@ export function useChannelComposerGlobalShortcuts({event.stopPropagation();return;}- ComponentDispatch.dispatch('ESCAPE_PRESSED', {channelId: channel.id});+ ComponentBus.dispatch('ESCAPE_PRESSED', {channelId: channel.id});event.preventDefault();};window.addEventListener('keydown', handleKeyDown);diff --git a/fluxer_app/src/features/channel/hooks/useChannelMemberListVisibility.ts b/fluxer_app/src/features/channel/hooks/useChannelMemberListVisibility.tsindex 731b313c1..e42e40d9b 100644--- a/fluxer_app/src/features/channel/hooks/useChannelMemberListVisibility.ts+++ b/fluxer_app/src/features/channel/hooks/useChannelMemberListVisibility.ts@@ -1,6 +1,6 @@// SPDX-License-Identifier: AGPL-3.0-or-later-import {ComponentDispatch} from '@app/features/platform/utils/ComponentBus';+import {ComponentBus} from '@app/features/platform/utils/ComponentBus';import {useEffect, useRef} from 'react';export function useChannelMemberListVisibility(channelId: string | null, visible: boolean): void {@@ -10,6 +10,6 @@ export function useChannelMemberListVisibility(channelId: string | null, visiblepreviousVisibilityRef.current = {channelId, visible};if (!channelId) return;if (previousVisibility.channelId === channelId && previousVisibility.visible === visible) return;- ComponentDispatch.dispatch('LAYOUT_RESIZED', {channelId});+ ComponentBus.dispatch('LAYOUT_RESIZED', {channelId});}, [channelId, visible]);}diff --git a/fluxer_app/src/features/channel/hooks/useChannelSearchVisibility.ts b/fluxer_app/src/features/channel/hooks/useChannelSearchVisibility.tsindex 4128ad4b8..b4b13e1ec 100644--- a/fluxer_app/src/features/channel/hooks/useChannelSearchVisibility.ts+++ b/fluxer_app/src/features/channel/hooks/useChannelSearchVisibility.ts@@ -1,6 +1,6 @@// SPDX-License-Identifier: AGPL-3.0-or-later-import {ComponentDispatch} from '@app/features/platform/utils/ComponentBus';+import {ComponentBus} from '@app/features/platform/utils/ComponentBus';import {useEffect, useRef} from 'react';export function useChannelSearchVisibility(channelId: string | null, visible: boolean): void {@@ -10,6 +10,6 @@ export function useChannelSearchVisibility(channelId: string | null, visible: bopreviousVisibilityRef.current = {channelId, visible};if (!channelId) return;if (previousVisibility.channelId === channelId && previousVisibility.visible === visible) return;- ComponentDispatch.dispatch('LAYOUT_RESIZED', {channelId});+ ComponentBus.dispatch('LAYOUT_RESIZED', {channelId});}, [channelId, visible]);}diff --git a/fluxer_app/src/features/channel/state/QuickReactionStore.ts b/fluxer_app/src/features/channel/state/QuickReactionStore.tsindex f95714b5e..33669d89b 100644--- a/fluxer_app/src/features/channel/state/QuickReactionStore.ts+++ b/fluxer_app/src/features/channel/state/QuickReactionStore.ts@@ -9,13 +9,13 @@ type QuickReactionSnapshot = ReadonlyArray<FlatEmoji>;type EmojiState = typeof import('@app/features/emoji/state/Emoji')['default'];type EmojiPickerState = typeof import('@app/features/emoji/state/EmojiPicker')['default'];type PermissionState = typeof import('@app/features/permissions/state/Permission')['default'];-type ComponentDispatchState = typeof import('@app/features/platform/utils/ComponentBus')['ComponentDispatch'];+type ComponentBusState = typeof import('@app/features/platform/utils/ComponentBus')['ComponentBus'];interface QuickReactionDependencies {Emoji: EmojiState;EmojiPicker: EmojiPickerState;Permission: PermissionState;- ComponentDispatch: ComponentDispatchState;+ ComponentBus: ComponentBusState;}const EMPTY_QUICK_REACTIONS: QuickReactionSnapshot = Object.freeze([]);@@ -39,11 +39,11 @@ function loadQuickReactionDependencies(): Promise<QuickReactionDependencies> {Emoji: emojiModule.default,EmojiPicker: emojiPickerModule.default,Permission: permissionModule.default,- ComponentDispatch: componentBusModule.ComponentDispatch,+ ComponentBus: componentBusModule.ComponentBus,};if (!dependencies) {dependencies = loaded;- loaded.ComponentDispatch.subscribe('EMOJI_PICKER_RERENDER', () => {+ loaded.ComponentBus.subscribe('EMOJI_PICKER_RERENDER', () => {cacheEpoch += 1;});loaded.Permission.subscribe(() => {diff --git a/fluxer_app/src/features/devtools/commands/DeveloperOptionsCommands.ts b/fluxer_app/src/features/devtools/commands/DeveloperOptionsCommands.tsindex 8bce923e9..4c99787c2 100644--- a/fluxer_app/src/features/devtools/commands/DeveloperOptionsCommands.ts+++ b/fluxer_app/src/features/devtools/commands/DeveloperOptionsCommands.ts@@ -3,7 +3,7 @@import {Channel} from '@app/features/channel/models/Channel';import DeveloperOptions, {type DeveloperOptionsState} from '@app/features/devtools/state/DeveloperOptions';import {Logger} from '@app/features/platform/utils/AppLogger';-import {ComponentDispatch} from '@app/features/platform/utils/ComponentBus';+import {ComponentBus} from '@app/features/platform/utils/ComponentBus';import {User} from '@app/features/user/models/User';import Users from '@app/features/user/state/Users';import MockIncomingCall from '@app/features/voice/state/MockIncomingCall';@@ -18,7 +18,7 @@ type AttachmentMock = DeveloperOptionsState['mockAttachmentStates'][string];export type MockIncomingCallVariant = 'dm' | 'group-dm';function publishLayoutResize(): void {- ComponentDispatch.dispatch('LAYOUT_RESIZED');+ ComponentBus.dispatch('LAYOUT_RESIZED');}function nextAttachmentMocks(diff --git a/fluxer_app/src/features/emoji/state/Emoji.ts b/fluxer_app/src/features/emoji/state/Emoji.tsindex 6a939ab27..d77b5a9b6 100644--- a/fluxer_app/src/features/emoji/state/Emoji.ts+++ b/fluxer_app/src/features/emoji/state/Emoji.ts@@ -13,7 +13,7 @@ import {checkEmojiAvailability} from '@app/features/expressions/utils/Expressionimport UnicodeEmojis from '@app/features/expressions/utils/UnicodeEmojis';import type {GuildReadyData} from '@app/features/gateway/types/GatewayGuildTypes';import GuildList from '@app/features/guild/state/GuildList';-import {ComponentDispatch} from '@app/features/platform/utils/ComponentBus';+import {ComponentBus} from '@app/features/platform/utils/ComponentBus';import {makeSyncedField} from '@app/features/user/state/SyncedField';import type {GuildEmoji as WireGuildEmoji} from '@fluxer/schema/src/domains/guild/GuildEmojiSchemas';import type {Guild as WireGuild} from '@fluxer/schema/src/domains/guild/GuildResponseSchemas';@@ -452,27 +452,27 @@ class Emoji {for (const guild of guilds) {emojiGuildRegistry.updateGuild(guild.id, guild.emojis);}- ComponentDispatch.dispatch('EMOJI_PICKER_RERENDER');+ ComponentBus.dispatch('EMOJI_PICKER_RERENDER');}handleGuildUpdate({guild}: {guild: GuildReadyData | WireGuild}): void {if (!('emojis' in guild)) {- ComponentDispatch.dispatch('EMOJI_PICKER_RERENDER');+ ComponentBus.dispatch('EMOJI_PICKER_RERENDER');return;}emojiGuildRegistry.updateGuild(guild.id, guild.emojis);- ComponentDispatch.dispatch('EMOJI_PICKER_RERENDER');+ ComponentBus.dispatch('EMOJI_PICKER_RERENDER');}handleGuildEmojiUpdated({guildId, emojis}: {guildId: string; emojis: ReadonlyArray<WireGuildEmoji>}): void {emojiGuildRegistry.updateGuild(guildId, emojis);patchGuildEmojiCacheFromGateway(guildId, emojis);- ComponentDispatch.dispatch('EMOJI_PICKER_RERENDER');+ ComponentBus.dispatch('EMOJI_PICKER_RERENDER');}handleGuildDelete({guildId}: {guildId: string}): void {emojiGuildRegistry.deleteGuild(guildId);- ComponentDispatch.dispatch('EMOJI_PICKER_RERENDER');+ ComponentBus.dispatch('EMOJI_PICKER_RERENDER');}}diff --git a/fluxer_app/src/features/emoji/state/EmojiPicker.ts b/fluxer_app/src/features/emoji/state/EmojiPicker.tsindex dd250414a..b16365157 100644--- a/fluxer_app/src/features/emoji/state/EmojiPicker.ts+++ b/fluxer_app/src/features/emoji/state/EmojiPicker.ts@@ -16,7 +16,7 @@ import {} from '@app/features/emoji/state/UsageFrecency';import type {FlatEmoji} from '@app/features/emoji/types/EmojiTypes';import {Logger} from '@app/features/platform/utils/AppLogger';-import {ComponentDispatch} from '@app/features/platform/utils/ComponentBus';+import {ComponentBus} from '@app/features/platform/utils/ComponentBus';import {makeSyncedField} from '@app/features/user/state/SyncedField';import {EmojiPickerStateSchema} from '@fluxer/schema/src/gen/fluxer/user/preferences/v1/pickers_pb';import {makeAutoObservable, untracked} from 'mobx';@@ -125,7 +125,7 @@ class EmojiPicker {this._favoriteSet = new Set(this.favoriteEmojis);this._collapsedSet = new Set(this.collapsedCategories);this.rankingDirty = true;- ComponentDispatch.dispatch('EMOJI_PICKER_RERENDER');+ ComponentBus.dispatch('EMOJI_PICKER_RERENDER');}getRanking(): UsageRanking {@@ -167,7 +167,7 @@ class EmojiPicker {this._favoriteSet.add(emojiKey);this.favoriteEmojis.push(emojiKey);}- ComponentDispatch.dispatch('EMOJI_PICKER_RERENDER');+ ComponentBus.dispatch('EMOJI_PICKER_RERENDER');}toggleCategory(category: string): void {@@ -182,7 +182,7 @@ class EmojiPicker {this._collapsedSet.add(category);this.collapsedCategories.push(category);}- ComponentDispatch.dispatch('EMOJI_PICKER_RERENDER');+ ComponentBus.dispatch('EMOJI_PICKER_RERENDER');}isFavorite(emoji: FlatEmoji): boolean {diff --git a/fluxer_app/src/features/emoji/state/EmojiSticker.ts b/fluxer_app/src/features/emoji/state/EmojiSticker.tsindex 0bcfdfda3..fd0e8229c 100644--- a/fluxer_app/src/features/emoji/state/EmojiSticker.ts+++ b/fluxer_app/src/features/emoji/state/EmojiSticker.ts@@ -5,7 +5,7 @@ import StickerPicker from '@app/features/emoji/state/StickerPicker';import {GuildSticker} from '@app/features/expressions/models/GuildSticker';import {patchGuildStickerCacheFromGateway} from '@app/features/expressions/state/GuildExpressionTabCache';import type {GuildReadyData} from '@app/features/gateway/types/GatewayGuildTypes';-import {ComponentDispatch} from '@app/features/platform/utils/ComponentBus';+import {ComponentBus} from '@app/features/platform/utils/ComponentBus';import type {GuildSticker as WireGuildSticker} from '@fluxer/schema/src/domains/guild/GuildEmojiSchemas';import {sortBySnowflakeDesc} from '@fluxer/snowflake/src/SnowflakeUtils';import {makeAutoObservable} from 'mobx';@@ -104,7 +104,7 @@ class Sticker {}}}- ComponentDispatch.dispatch('STICKER_PICKER_RERENDER');+ ComponentBus.dispatch('STICKER_PICKER_RERENDER');}handleGuildUpdate(guild: GuildStickersPayload): void {@@ -125,7 +125,7 @@ class Sticker {this.stickerById.delete(oldSticker.id);}this.guildStickers.delete(guildId);- ComponentDispatch.dispatch('STICKER_PICKER_RERENDER');+ ComponentBus.dispatch('STICKER_PICKER_RERENDER');}private updateGuildStickers(guildId: string, guildStickers: ReadonlyArray<WireGuildSticker>): void {@@ -139,7 +139,7 @@ class Sticker {for (const sticker of sortedStickers) {this.stickerById.set(sticker.id, sticker);}- ComponentDispatch.dispatch('STICKER_PICKER_RERENDER');+ ComponentBus.dispatch('STICKER_PICKER_RERENDER');}private sortByFrecency(stickers: ReadonlyArray<GuildSticker>): ReadonlyArray<GuildSticker> {diff --git a/fluxer_app/src/features/emoji/state/MemesPicker.ts b/fluxer_app/src/features/emoji/state/MemesPicker.tsindex ea4500639..dd52f46ad 100644--- a/fluxer_app/src/features/emoji/state/MemesPicker.ts+++ b/fluxer_app/src/features/emoji/state/MemesPicker.ts@@ -13,7 +13,7 @@ import {} from '@app/features/emoji/state/UsageFrecency';import type {FavoriteMeme} from '@app/features/expressions/models/FavoriteMeme';import {Logger} from '@app/features/platform/utils/AppLogger';-import {ComponentDispatch} from '@app/features/platform/utils/ComponentBus';+import {ComponentBus} from '@app/features/platform/utils/ComponentBus';import {makeSyncedField} from '@app/features/user/state/SyncedField';import {MemesPickerStateSchema} from '@fluxer/schema/src/gen/fluxer/user/preferences/v1/pickers_pb';import {makeAutoObservable} from 'mobx';@@ -81,7 +81,7 @@ class MemesPicker {} else {this.favoriteMemes.push(memeKey);}- ComponentDispatch.dispatch('MEMES_PICKER_RERENDER');+ ComponentBus.dispatch('MEMES_PICKER_RERENDER');logger.debug(`Toggled favorite meme: ${memeKey}`);}@@ -94,7 +94,7 @@ class MemesPicker {} else {this.collapsedCategories.push(category);}- ComponentDispatch.dispatch('MEMES_PICKER_RERENDER');+ ComponentBus.dispatch('MEMES_PICKER_RERENDER');logger.debug(`Toggled category: ${category}`);}diff --git a/fluxer_app/src/features/emoji/state/StickerPicker.ts b/fluxer_app/src/features/emoji/state/StickerPicker.tsindex cfd2f6a43..d1588c613 100644--- a/fluxer_app/src/features/emoji/state/StickerPicker.ts+++ b/fluxer_app/src/features/emoji/state/StickerPicker.ts@@ -13,7 +13,7 @@ import {} from '@app/features/emoji/state/UsageFrecency';import type {GuildSticker} from '@app/features/expressions/models/GuildSticker';import {Logger} from '@app/features/platform/utils/AppLogger';-import {ComponentDispatch} from '@app/features/platform/utils/ComponentBus';+import {ComponentBus} from '@app/features/platform/utils/ComponentBus';import {makeSyncedField} from '@app/features/user/state/SyncedField';import {StickerPickerStateSchema} from '@fluxer/schema/src/gen/fluxer/user/preferences/v1/pickers_pb';import {makeAutoObservable} from 'mobx';@@ -82,7 +82,7 @@ class StickerPicker {} else {this.favoriteStickers.push(stickerKey);}- ComponentDispatch.dispatch('STICKER_PICKER_RERENDER');+ ComponentBus.dispatch('STICKER_PICKER_RERENDER');logger.debug(`Toggled favorite sticker: ${stickerKey}`);}@@ -95,7 +95,7 @@ class StickerPicker {} else {this.collapsedCategories.push(category);}- ComponentDispatch.dispatch('STICKER_PICKER_RERENDER');+ ComponentBus.dispatch('STICKER_PICKER_RERENDER');logger.debug(`Toggled category: ${category}`);}diff --git a/fluxer_app/src/features/expressions/components/modals/ExpressionPickerSheet.tsx b/fluxer_app/src/features/expressions/components/modals/ExpressionPickerSheet.tsxindex b65113e7f..8ea7b01e7 100644--- a/fluxer_app/src/features/expressions/components/modals/ExpressionPickerSheet.tsx+++ b/fluxer_app/src/features/expressions/components/modals/ExpressionPickerSheet.tsx@@ -22,7 +22,7 @@ import {MEDIA_DESCRIPTOR,STICKERS_DESCRIPTOR,} from '@app/features/i18n/utils/CommonMessageDescriptors';-import {ComponentDispatch} from '@app/features/platform/utils/ComponentBus';+import {ComponentBus} from '@app/features/platform/utils/ComponentBus';import {BottomSheet} from '@app/features/ui/bottom_sheet/BottomSheet';import {type SegmentedTab, SegmentedTabs} from '@app/features/ui/segmented_tabs/SegmentedTabs';import type {MessageDescriptor} from '@lingui/core';@@ -81,7 +81,7 @@ const EXPRESSION_PICKER_CATEGORY_DESCRIPTORS: Array<ExpressionPickerCategoryDescif (StickerSendUtils.shouldSetPendingSticker(channelId)) {StickerSendUtils.setPendingSticker(channelId, sticker);} else {- ComponentDispatch.dispatch('STICKER_SELECT', {sticker});+ ComponentBus.dispatch('STICKER_SELECT', {sticker});}if (!shiftKey) {onClose?.();diff --git a/fluxer_app/src/features/expressions/components/popouts/ExpressionPickerPopout.tsx b/fluxer_app/src/features/expressions/components/popouts/ExpressionPickerPopout.tsxindex 1410fd7d1..f4f55450b 100644--- a/fluxer_app/src/features/expressions/components/popouts/ExpressionPickerPopout.tsx+++ b/fluxer_app/src/features/expressions/components/popouts/ExpressionPickerPopout.tsx@@ -18,7 +18,7 @@ import {MEDIA_DESCRIPTOR,STICKERS_DESCRIPTOR,} from '@app/features/i18n/utils/CommonMessageDescriptors';-import {ComponentDispatch} from '@app/features/platform/utils/ComponentBus';+import {ComponentBus} from '@app/features/platform/utils/ComponentBus';import {remFromPx} from '@app/features/theme/layout/RemFromPx';import type {ResizeEdge} from '@app/features/ui/floating_pane/FloatingPaneMath';import {useResizablePane} from '@app/features/ui/hooks/useResizablePane';@@ -110,7 +110,7 @@ const createAllCategories = (i18n: I18n): Array<ExpressionPickerCategory> => [if (StickerSendUtils.shouldSetPendingSticker(channelId)) {StickerSendUtils.setPendingSticker(channelId, sticker);} else {- ComponentDispatch.dispatch('STICKER_SELECT', {sticker});+ ComponentBus.dispatch('STICKER_SELECT', {sticker});}if (onClose && !shiftKey) {onClose();diff --git a/fluxer_app/src/features/inbox/commands/InboxCommands.tsx b/fluxer_app/src/features/inbox/commands/InboxCommands.tsxindex cd6ea0604..291e1c4a7 100644--- a/fluxer_app/src/features/inbox/commands/InboxCommands.tsx+++ b/fluxer_app/src/features/inbox/commands/InboxCommands.tsx@@ -6,7 +6,7 @@ import {CANCEL_DESCRIPTOR, MARK_AS_READ_DESCRIPTOR} from '@app/features/i18n/utiimport type {InboxTab} from '@app/features/inbox/state/Inbox';import Inbox from '@app/features/inbox/state/Inbox';import {focusChannelTextareaAfterNavigation} from '@app/features/messaging/utils/ChannelTextareaFocusUtils';-import {ComponentDispatch} from '@app/features/platform/utils/ComponentBus';+import {ComponentBus} from '@app/features/platform/utils/ComponentBus';import * as ReadStateCommands from '@app/features/read_state/commands/ReadStateCommands';import {Checkbox} from '@app/features/ui/checkbox/Checkbox';import * as ModalCommands from '@app/features/ui/commands/ModalCommands';@@ -46,13 +46,13 @@ export function revealBookmarksPopoutForFirstSave(): boolean {return false;}const isInboxOpen = Popout.isOpen('inbox');- const canOpenInbox = isInboxOpen || ComponentDispatch.hasSubscribers('INBOX_OPEN');+ const canOpenInbox = isInboxOpen || ComponentBus.hasSubscribers('INBOX_OPEN');if (!canOpenInbox) {return false;}Inbox.setTab('bookmarks');if (!isInboxOpen) {- ComponentDispatch.dispatch('INBOX_OPEN');+ ComponentBus.dispatch('INBOX_OPEN');}Inbox.markBookmarksPopoutAutoOpenedForFirstSave();return true;diff --git a/fluxer_app/src/features/lexical/composer/useLexicalAutocomplete.ts b/fluxer_app/src/features/lexical/composer/useLexicalAutocomplete.tsindex 1519d06f6..e0dab0786 100644--- a/fluxer_app/src/features/lexical/composer/useLexicalAutocomplete.ts+++ b/fluxer_app/src/features/lexical/composer/useLexicalAutocomplete.ts@@ -78,7 +78,7 @@ import {import MentionFrecency from '@app/features/notification/state/MentionFrecency';import Permission from '@app/features/permissions/state/Permission';import * as PermissionUtils from '@app/features/permissions/utils/PermissionUtils';-import {ComponentDispatch} from '@app/features/platform/utils/ComponentBus';+import {ComponentBus} from '@app/features/platform/utils/ComponentBus';import type {User} from '@app/features/user/models/User';import Users from '@app/features/user/state/Users';import {formatUserTagForStreamerMode} from '@app/features/user/utils/DisplayNameUtils';@@ -196,8 +196,8 @@ export function useLexicalAutocomplete({function handleExpressionDataUpdated(): void {setExpressionDataVersion((version) => version + 1);}- const unsubscribeEmoji = ComponentDispatch.subscribe('EMOJI_PICKER_RERENDER', handleExpressionDataUpdated);- const unsubscribeSticker = ComponentDispatch.subscribe('STICKER_PICKER_RERENDER', handleExpressionDataUpdated);+ const unsubscribeEmoji = ComponentBus.subscribe('EMOJI_PICKER_RERENDER', handleExpressionDataUpdated);+ const unsubscribeSticker = ComponentBus.subscribe('STICKER_PICKER_RERENDER', handleExpressionDataUpdated);return () => {unsubscribeEmoji();unsubscribeSticker();@@ -652,17 +652,17 @@ export function useLexicalAutocomplete({return;}if (isMeme(option)) {- ComponentDispatch.dispatch('FAVORITE_MEME_SELECT', {meme: option.meme, autoSend: true});+ ComponentBus.dispatch('FAVORITE_MEME_SELECT', {meme: option.meme, autoSend: true});handle.clear();return;}if (isGif(option)) {- ComponentDispatch.dispatch('GIF_SELECT', {gif: option.gif, autoSend: true});+ ComponentBus.dispatch('GIF_SELECT', {gif: option.gif, autoSend: true});handle.clear();return;}if (isSticker(option)) {- ComponentDispatch.dispatch('STICKER_SELECT', {sticker: option.sticker});+ ComponentBus.dispatch('STICKER_SELECT', {sticker: option.sticker});handle.clear();return;}diff --git a/fluxer_app/src/features/messaging/commands/MessageCommands.tsx b/fluxer_app/src/features/messaging/commands/MessageCommands.tsxindex 0138728aa..6e21bc489 100644--- a/fluxer_app/src/features/messaging/commands/MessageCommands.tsx+++ b/fluxer_app/src/features/messaging/commands/MessageCommands.tsx@@ -42,7 +42,7 @@ import {http} from '@app/features/platform/transport/RestTransport';import {HttpError} from '@app/features/platform/types/EndpointError';import type {RestResponse} from '@app/features/platform/types/TransportTypes';import {Logger} from '@app/features/platform/utils/AppLogger';-import {ComponentDispatch} from '@app/features/platform/utils/ComponentBus';+import {ComponentBus} from '@app/features/platform/utils/ComponentBus';import {failureCode} from '@app/features/platform/utils/ResponseInspection';import * as ReadStateCommands from '@app/features/read_state/commands/ReadStateCommands';import ReadStates from '@app/features/read_state/state/ReadStates';@@ -728,12 +728,12 @@ export function revealMessage(channelId: string, messageId: string | null): voidexport function startReply(channelId: string, messageId: string, mentioning: boolean): void {logger.debug(`Starting reply to message ${messageId} in channel ${channelId}, mentioning=${mentioning}`);MessageReply.startReply(channelId, messageId, mentioning);- ComponentDispatch.dispatch('FOCUS_TEXTAREA', {channelId});+ ComponentBus.dispatch('FOCUS_TEXTAREA', {channelId});window.requestAnimationFrame(() => {- ComponentDispatch.dispatch('FOCUS_TEXTAREA', {channelId});+ ComponentBus.dispatch('FOCUS_TEXTAREA', {channelId});});window.setTimeout(() => {- ComponentDispatch.dispatch('FOCUS_TEXTAREA', {channelId});+ ComponentBus.dispatch('FOCUS_TEXTAREA', {channelId});}, 300);}diff --git a/fluxer_app/src/features/messaging/hooks/useMarkdownKeybinds.ts b/fluxer_app/src/features/messaging/hooks/useMarkdownKeybinds.tsindex 75c09c9f9..937601d27 100644--- a/fluxer_app/src/features/messaging/hooks/useMarkdownKeybinds.ts+++ b/fluxer_app/src/features/messaging/hooks/useMarkdownKeybinds.ts@@ -6,7 +6,7 @@ import Keybind, {type KeyCombo,} from '@app/features/input/state/InputKeybind';import {replaceTextRange, setTextSelectionSoon} from '@app/features/messaging/utils/TextInputEditUtils';-import {ComponentDispatch} from '@app/features/platform/utils/ComponentBus';+import {ComponentBus} from '@app/features/platform/utils/ComponentBus';import type React from 'react';import {type KeyboardEvent, useCallback, useEffect} from 'react';@@ -198,7 +198,7 @@ export const useMarkdownFormattingShortcut = ({if (doesEventMatchShortcut(event, inboxCombo) && selectionStart === selectionEnd && value.trim().length === 0) {event.preventDefault();event.stopPropagation();- ComponentDispatch.dispatch('INBOX_OPEN');+ ComponentBus.dispatch('INBOX_OPEN');return;}for (const {combo: shortcutCombo, wrapper} of MARKDOWN_FORMATTING_SHORTCUTS) {diff --git a/fluxer_app/src/features/messaging/hooks/useMessageSubmission.tsx b/fluxer_app/src/features/messaging/hooks/useMessageSubmission.tsxindex 4e389e7e6..7f161699d 100644--- a/fluxer_app/src/features/messaging/hooks/useMessageSubmission.tsx+++ b/fluxer_app/src/features/messaging/hooks/useMessageSubmission.tsx@@ -7,7 +7,7 @@ import {Message} from '@app/features/messaging/models/MessagingMessage';import * as MessageSubmitUtils from '@app/features/messaging/utils/MessageSubmitUtils';import {formatUploadingAttachmentSummary} from '@app/features/messaging/utils/UploadingAttachmentLabelUtils';import Permission from '@app/features/permissions/state/Permission';-import {ComponentDispatch} from '@app/features/platform/utils/ComponentBus';+import {ComponentBus} from '@app/features/platform/utils/ComponentBus';import * as SlowmodeCommands from '@app/features/slowmode/commands/SlowmodeCommands';import {SlowmodeRateLimitedModal} from '@app/features/slowmode/components/alerts/SlowmodeRateLimitedModal';import Slowmode from '@app/features/slowmode/state/Slowmode';@@ -153,7 +153,7 @@ export const useMessageSubmission = ({channel, referencedMessage, replyingMessag.catch(() => {SlowmodeCommands.discardPendingMessageSend(channel.id, pendingSend);});- ComponentDispatch.dispatch('MESSAGE_SENT', {channelId: channel.id});+ ComponentBus.dispatch('MESSAGE_SENT', {channelId: channel.id});return true;},[channel?.id, i18n, referencedMessage, replyingMessage],@@ -226,7 +226,7 @@ export const useMessageSubmission = ({channel, referencedMessage, replyingMessag.catch(() => {SlowmodeCommands.discardPendingMessageSend(channel.id, pendingSend);});- ComponentDispatch.dispatch('MESSAGE_SENT', {channelId: channel.id});+ ComponentBus.dispatch('MESSAGE_SENT', {channelId: channel.id});},[channel?.id, referencedMessage, replyingMessage],);diff --git a/fluxer_app/src/features/messaging/hooks/useTextareaAutocomplete.ts b/fluxer_app/src/features/messaging/hooks/useTextareaAutocomplete.tsindex c1c1638e0..7ecc60939 100644--- a/fluxer_app/src/features/messaging/hooks/useTextareaAutocomplete.ts+++ b/fluxer_app/src/features/messaging/hooks/useTextareaAutocomplete.ts@@ -63,7 +63,7 @@ import MentionFrecency from '@app/features/notification/state/MentionFrecency';import Permission from '@app/features/permissions/state/Permission';import * as PermissionUtils from '@app/features/permissions/utils/PermissionUtils';import {Logger} from '@app/features/platform/utils/AppLogger';-import {ComponentDispatch} from '@app/features/platform/utils/ComponentBus';+import {ComponentBus} from '@app/features/platform/utils/ComponentBus';import Users from '@app/features/user/state/Users';import * as NicknameUtils from '@app/features/user/utils/NicknameUtils';import {Permissions} from '@fluxer/constants/src/ChannelConstants';@@ -182,8 +182,8 @@ export function useTextareaAutocomplete({function handleExpressionDataUpdated(): void {setExpressionDataVersion((version) => version + 1);}- const unsubscribeEmoji = ComponentDispatch.subscribe('EMOJI_PICKER_RERENDER', handleExpressionDataUpdated);- const unsubscribeSticker = ComponentDispatch.subscribe('STICKER_PICKER_RERENDER', handleExpressionDataUpdated);+ const unsubscribeEmoji = ComponentBus.subscribe('EMOJI_PICKER_RERENDER', handleExpressionDataUpdated);+ const unsubscribeSticker = ComponentBus.subscribe('STICKER_PICKER_RERENDER', handleExpressionDataUpdated);return () => {unsubscribeEmoji();unsubscribeSticker();@@ -706,19 +706,19 @@ export function useTextareaAutocomplete({return;}if (isMeme(option)) {- ComponentDispatch.dispatch('FAVORITE_MEME_SELECT', {meme: option.meme, autoSend: true});+ ComponentBus.dispatch('FAVORITE_MEME_SELECT', {meme: option.meme, autoSend: true});applyAutocompleteValue('', [], 0);setSelectedIndex(0);return;}if (isGif(option)) {- ComponentDispatch.dispatch('GIF_SELECT', {gif: option.gif, autoSend: true});+ ComponentBus.dispatch('GIF_SELECT', {gif: option.gif, autoSend: true});applyAutocompleteValue('', [], 0);setSelectedIndex(0);return;}if (isSticker(option)) {- ComponentDispatch.dispatch('STICKER_SELECT', {sticker: option.sticker});+ ComponentBus.dispatch('STICKER_SELECT', {sticker: option.sticker});applyAutocompleteValue('', [], 0);setSelectedIndex(0);return;diff --git a/fluxer_app/src/features/messaging/hooks/useTextareaExpressionHandlers.ts b/fluxer_app/src/features/messaging/hooks/useTextareaExpressionHandlers.tsindex aae9aea81..f27b6d662 100644--- a/fluxer_app/src/features/messaging/hooks/useTextareaExpressionHandlers.ts+++ b/fluxer_app/src/features/messaging/hooks/useTextareaExpressionHandlers.ts@@ -10,7 +10,7 @@ import {type PrepareTextareaTextChange,} from '@app/features/messaging/utils/TextareaNativeEditUtils';import {type MentionSegment, TextareaSegmentManager} from '@app/features/messaging/utils/TextareaSegmentManager';-import {ComponentDispatch} from '@app/features/platform/utils/ComponentBus';+import {ComponentBus} from '@app/features/platform/utils/ComponentBus';import Users from '@app/features/user/state/Users';import * as NicknameUtils from '@app/features/user/utils/NicknameUtils';import type {MessageAttachment, MessageStickerItem} from '@fluxer/schema/src/domains/message/MessageResponseSchemas';@@ -93,7 +93,7 @@ export const useTextareaExpressionHandlers = ({appendText(gifUrl);}};- return ComponentDispatch.subscribe('GIF_SELECT', handleGifSelect);+ return ComponentBus.subscribe('GIF_SELECT', handleGifSelect);}, [appendText, sendOptimisticMessage, enabled]);useEffect(() => {const handleStickerSelect = (payload?: unknown) => {@@ -104,7 +104,7 @@ export const useTextareaExpressionHandlers = ({if (!sticker) return;sendOptimisticMessage({content: '', stickers: [sticker.toJSON()]}, {hasAttachments: false});};- return ComponentDispatch.subscribe('STICKER_SELECT', handleStickerSelect);+ return ComponentBus.subscribe('STICKER_SELECT', handleStickerSelect);}, [sendOptimisticMessage, enabled]);useEffect(() => {const handleFavoriteMemeSelect = (payload?: unknown) => {@@ -144,7 +144,7 @@ export const useTextareaExpressionHandlers = ({}}};- return ComponentDispatch.subscribe('FAVORITE_MEME_SELECT', handleFavoriteMemeSelect);+ return ComponentBus.subscribe('FAVORITE_MEME_SELECT', handleFavoriteMemeSelect);}, [appendText, canSendFavoriteMemeId, sendOptimisticMessage, enabled]);useEffect(() => {const handleInsertMention = (payload?: unknown) => {@@ -184,6 +184,6 @@ export const useTextareaExpressionHandlers = ({selectionStart: newText.length,});};- return ComponentDispatch.subscribe('INSERT_MENTION', handleInsertMention);+ return ComponentBus.subscribe('INSERT_MENTION', handleInsertMention);}, [insertSegment, previousValueRef, setValue, textareaRef, segmentManagerRef, prepareTextChange, enabled]);};diff --git a/fluxer_app/src/features/messaging/hooks/useTextareaExpressionPicker.tsx b/fluxer_app/src/features/messaging/hooks/useTextareaExpressionPicker.tsxindex cde605965..b269851cb 100644--- a/fluxer_app/src/features/messaging/hooks/useTextareaExpressionPicker.tsx+++ b/fluxer_app/src/features/messaging/hooks/useTextareaExpressionPicker.tsx@@ -5,7 +5,7 @@ import ExpressionPicker from '@app/features/emoji/state/ExpressionPicker';import type {FlatEmoji} from '@app/features/emoji/types/EmojiTypes';import type {ExpressionPickerTabType} from '@app/features/expressions/components/popouts/ExpressionPickerPopout';import {ExpressionPickerPopout} from '@app/features/expressions/components/popouts/ExpressionPickerPopout';-import {ComponentDispatch} from '@app/features/platform/utils/ComponentBus';+import {ComponentBus} from '@app/features/platform/utils/ComponentBus';import * as PopoutCommands from '@app/features/ui/commands/PopoutCommands';import {openPopout} from '@app/features/ui/popover/PopoverPopout';import MobileLayout from '@app/features/ui/state/MobileLayout';@@ -155,7 +155,7 @@ export const useTextareaExpressionPicker = ({enabled,]);useEffect(() => {- const unsubscribe = ComponentDispatch.subscribe('EXPRESSION_PICKER_TAB_TOGGLE', (payload?: unknown) => {+ const unsubscribe = ComponentBus.subscribe('EXPRESSION_PICKER_TAB_TOGGLE', (payload?: unknown) => {const data = payload as {channelId?: string; tab?: ExpressionPickerTabType} | undefined;if (!enabled) return;if (!data || data.channelId !== channelId || !data.tab) return;diff --git a/fluxer_app/src/features/messaging/hooks/useTextareaKeyboard.ts b/fluxer_app/src/features/messaging/hooks/useTextareaKeyboard.tsindex 26df42737..82bd4ea4f 100644--- a/fluxer_app/src/features/messaging/hooks/useTextareaKeyboard.ts+++ b/fluxer_app/src/features/messaging/hooks/useTextareaKeyboard.ts@@ -5,7 +5,7 @@ import type {Message} from '@app/features/messaging/models/MessagingMessage';import MessageEdit from '@app/features/messaging/state/MessageEdit';import MessageFocus from '@app/features/messaging/state/MessageFocus';import {insertTextAtCursor} from '@app/features/messaging/utils/TextInputEditUtils';-import {ComponentDispatch} from '@app/features/platform/utils/ComponentBus';+import {ComponentBus} from '@app/features/platform/utils/ComponentBus';import {canFocusTextarea, safeFocus} from '@app/features/platform/utils/InputFocusManager';import {isTextInputKeyEvent} from '@app/features/platform/utils/IsTextInputKeyEvent';import QuickSwitcher from '@app/features/search/state/QuickSwitcher';@@ -138,7 +138,7 @@ export const useTextareaKeyboard = ({MessageCommands.stopReply(channelId);} else {event.preventDefault();- ComponentDispatch.dispatch('ESCAPE_PRESSED');+ ComponentBus.dispatch('ESCAPE_PRESSED');}}};@@ -154,7 +154,7 @@ export const useTextareaKeyboard = ({}if (KeyboardMode.keyboardModeEnabled) {event.preventDefault();- ComponentDispatch.dispatch('FOCUS_BOTTOMMOST_MESSAGE', {channelId});+ ComponentBus.dispatch('FOCUS_BOTTOMMOST_MESSAGE', {channelId});return;}const message = getLastEditableMessage();diff --git a/fluxer_app/src/features/messaging/utils/ChannelTextareaFocusUtils.ts b/fluxer_app/src/features/messaging/utils/ChannelTextareaFocusUtils.tsindex d88e8bbb0..cf0148315 100644--- a/fluxer_app/src/features/messaging/utils/ChannelTextareaFocusUtils.ts+++ b/fluxer_app/src/features/messaging/utils/ChannelTextareaFocusUtils.ts@@ -1,10 +1,10 @@// SPDX-License-Identifier: AGPL-3.0-or-later-import {ComponentDispatch} from '@app/features/platform/utils/ComponentBus';+import {ComponentBus} from '@app/features/platform/utils/ComponentBus';export function focusChannelTextareaAfterNavigation(channelId: string): void {const requestFocus = () => {- ComponentDispatch.dispatch('FOCUS_TEXTAREA', {channelId});+ ComponentBus.dispatch('FOCUS_TEXTAREA', {channelId});};window.requestAnimationFrame(requestFocus);window.setTimeout(requestFocus, 300);diff --git a/fluxer_app/src/features/navigation/utils/DeepLinkUtils.ts b/fluxer_app/src/features/navigation/utils/DeepLinkUtils.tsindex dae23c621..f4a62796d 100644--- a/fluxer_app/src/features/navigation/utils/DeepLinkUtils.ts+++ b/fluxer_app/src/features/navigation/utils/DeepLinkUtils.ts@@ -8,7 +8,7 @@ import * as InviteCommands from '@app/features/invite/commands/InviteCommands';import {setPathQueryParams} from '@app/features/messaging/utils/MessagingUrlUtils';import * as RouterUtils from '@app/features/navigation/utils/RouterUtils';import {Logger} from '@app/features/platform/utils/AppLogger';-import {ComponentDispatch} from '@app/features/platform/utils/ComponentBus';+import {ComponentBus} from '@app/features/platform/utils/ComponentBus';import * as ModalCommands from '@app/features/ui/commands/ModalCommands';import {APP_PROTOCOL_SCHEME, isAppProtocolUrl} from '@app/features/ui/utils/AppProtocol';import {getElectronAPI} from '@app/features/ui/utils/NativeUtils';@@ -128,7 +128,7 @@ function openUserSettingsDeepLink(target: UserSettingsDeepLinkTarget): void {}),),);- ComponentDispatch.safeDispatch('USER_SETTINGS_TAB_SELECT', {tab: target.tab, section: target.section});+ ComponentBus.dispatchOrBuffer('USER_SETTINGS_TAB_SELECT', {tab: target.tab, section: target.section});}const navigateForTarget = (target: DeepLinkTarget) => {diff --git a/fluxer_app/src/features/platform/utils/ComponentBus.ts b/fluxer_app/src/features/platform/utils/ComponentBus.tsindex 3eb3148bb..c5e750d92 100644--- a/fluxer_app/src/features/platform/utils/ComponentBus.ts+++ b/fluxer_app/src/features/platform/utils/ComponentBus.ts@@ -29,7 +29,7 @@ export type ComponentActionType =| 'MESSAGE_SENT'| 'OPEN_MEMES_TAB'| 'POPOUT_CLOSE'- | 'SCROLLTO_PRESENT'+ | 'SCROLL_TO_PRESENT'| 'SCROLL_PAGE_DOWN'| 'SCROLL_PAGE_UP'| 'SOUNDBOARD_TOGGLE'@@ -39,20 +39,20 @@ export type ComponentActionType =| 'TEXTAREA_DISMISS_AFFORDANCE'| 'TEXTAREA_UPLOAD_FILE'| 'USER_SETTINGS_TAB_SELECT';-type ComponentDispatchEvents = {+type ComponentBusEvents = {[K in ComponentActionType]: (...args: Array<unknown>) => unknown;};-class Dispatch extends EventEmitter<ComponentDispatchEvents> {- private _savedDispatches: Partial<Record<ComponentActionType, Array<unknown>>> = {};- private logger = new Logger('ComponentDispatch');+class Dispatch extends EventEmitter<ComponentBusEvents> {+ private bufferedDispatches: Partial<Record<ComponentActionType, Array<unknown>>> = {};+ private logger = new Logger('ComponentBus');- safeDispatch(type: ComponentActionType, args?: unknown) {+ dispatchOrBuffer(type: ComponentActionType, args?: unknown) {if (!this.hasSubscribers(type)) {- if (!this._savedDispatches[type]) {- this._savedDispatches[type] = [];+ if (!this.bufferedDispatches[type]) {+ this.bufferedDispatches[type] = [];}- this._savedDispatches[type].push(args);+ this.bufferedDispatches[type].push(args);return;}this.dispatch(type, args);@@ -62,7 +62,7 @@ class Dispatch extends EventEmitter<ComponentDispatchEvents> {this.emit(type, args);}- dispatchToLastSubscribed(type: ComponentActionType, args?: unknown) {+ dispatchToNewestSubscriber(type: ComponentActionType, args?: unknown) {const listeners = this.listeners(type);if (listeners.length > 0) {listeners[listeners.length - 1](args);@@ -90,24 +90,24 @@ class Dispatch extends EventEmitter<ComponentDispatchEvents> {return this.listenerCount(type) > 0;}- private _checkSavedDispatches(type: ComponentActionType) {- if (this._savedDispatches[type]) {- for (const args of this._savedDispatches[type]) {+ private flushBufferedDispatches(type: ComponentActionType) {+ if (this.bufferedDispatches[type]) {+ for (const args of this.bufferedDispatches[type]) {this.dispatch(type, args);}- delete this._savedDispatches[type];+ delete this.bufferedDispatches[type];}}subscribe(type: ComponentActionType, callback: (...args: Array<unknown>) => void): () => void {if (this.listeners(type).includes(callback)) {- this.logger.warn('ComponentDispatch.subscribe: Attempting to add a duplicate listener', type);+ this.logger.warn('Ignoring duplicate subscriber for component action', type);return () => {this.unsubscribe(type, callback);};}this.on(type, callback);- this._checkSavedDispatches(type);+ this.flushBufferedDispatches(type);return () => {this.unsubscribe(type, callback);};@@ -115,7 +115,7 @@ class Dispatch extends EventEmitter<ComponentDispatchEvents> {subscribeOnce(type: ComponentActionType, callback: (...args: Array<unknown>) => void): () => void {this.once(type, callback);- this._checkSavedDispatches(type);+ this.flushBufferedDispatches(type);return () => {this.unsubscribe(type, callback);};@@ -130,4 +130,4 @@ class Dispatch extends EventEmitter<ComponentDispatchEvents> {}}-export const ComponentDispatch = new Dispatch();+export const ComponentBus = new Dispatch();diff --git a/fluxer_app/src/features/premium/components/PremiumCheckoutReturnWatcher.tsx b/fluxer_app/src/features/premium/components/PremiumCheckoutReturnWatcher.tsxindex 261144e2e..c4f45542a 100644--- a/fluxer_app/src/features/premium/components/PremiumCheckoutReturnWatcher.tsx+++ b/fluxer_app/src/features/premium/components/PremiumCheckoutReturnWatcher.tsx@@ -1,6 +1,6 @@// SPDX-License-Identifier: AGPL-3.0-or-later-import {ComponentDispatch} from '@app/features/platform/utils/ComponentBus';+import {ComponentBus} from '@app/features/platform/utils/ComponentBus';import * as PremiumCommands from '@app/features/premium/commands/PremiumCommands';import {consumeCompletedPremiumCheckoutReturnIntent,@@ -53,7 +53,7 @@ export const PremiumCheckoutReturnWatcher = observer(() => {<UserSettingsModal initialTab="plutonium" data-flx="premium.checkout-return-watcher.user-settings-modal" />)),);- ComponentDispatch.safeDispatch('USER_SETTINGS_TAB_SELECT', {tab: 'plutonium'});+ ComponentBus.dispatchOrBuffer('USER_SETTINGS_TAB_SELECT', {tab: 'plutonium'});}, [isPremium, currentUserId, showPremiumFeatures]);return null;});diff --git a/fluxer_app/src/features/streamer_mode/components/StreamerModeGate.tsx b/fluxer_app/src/features/streamer_mode/components/StreamerModeGate.tsxindex b18fe88b9..0fc8c6db4 100644--- a/fluxer_app/src/features/streamer_mode/components/StreamerModeGate.tsx+++ b/fluxer_app/src/features/streamer_mode/components/StreamerModeGate.tsx@@ -1,6 +1,6 @@// SPDX-License-Identifier: AGPL-3.0-or-later-import {ComponentDispatch} from '@app/features/platform/utils/ComponentBus';+import {ComponentBus} from '@app/features/platform/utils/ComponentBus';import styles from '@app/features/streamer_mode/components/StreamerModeGate.module.css';import {Button} from '@app/features/ui/button/Button';import {msg} from '@lingui/core/macro';@@ -28,7 +28,7 @@ const GO_TO_STREAMER_MODE_SETTINGS_DESCRIPTOR = msg({export const StreamerModeGate: React.FC = () => {const {i18n} = useLingui();const goToStreamerModeSettings = () => {- ComponentDispatch.dispatch('USER_SETTINGS_TAB_SELECT', {tab: 'appearance', section: 'streamer-mode'});+ ComponentBus.dispatch('USER_SETTINGS_TAB_SELECT', {tab: 'appearance', section: 'streamer-mode'});};return (<div className={styles.screen} data-flx="streamer-mode.gate.screen">diff --git a/fluxer_app/src/features/ui/action_menu/items/MentionUserMenuItem.tsx b/fluxer_app/src/features/ui/action_menu/items/MentionUserMenuItem.tsxindex c16d75248..0cec870fd 100644--- a/fluxer_app/src/features/ui/action_menu/items/MentionUserMenuItem.tsx+++ b/fluxer_app/src/features/ui/action_menu/items/MentionUserMenuItem.tsx@@ -1,6 +1,6 @@// SPDX-License-Identifier: AGPL-3.0-or-later-import {ComponentDispatch} from '@app/features/platform/utils/ComponentBus';+import {ComponentBus} from '@app/features/platform/utils/ComponentBus';import {MentionUserIcon} from '@app/features/ui/action_menu/ContextMenuIcons';import {MenuItem} from '@app/features/ui/action_menu/MenuItem';import type {User} from '@app/features/user/models/User';@@ -24,7 +24,7 @@ export const MentionUserMenuItem: React.FC<MentionUserMenuItemProps> = observer(const {i18n} = useLingui();const handleMentionUser = useCallback(() => {onClose();- ComponentDispatch.dispatch('INSERT_MENTION', {userId: user.id});+ ComponentBus.dispatch('INSERT_MENTION', {userId: user.id});}, [user.id, onClose]);return (<MenuItemdiff --git a/fluxer_app/src/features/ui/action_menu/items/VoiceParticipantMenuData.tsx b/fluxer_app/src/features/ui/action_menu/items/VoiceParticipantMenuData.tsxindex e7241aed9..08467a900 100644--- a/fluxer_app/src/features/ui/action_menu/items/VoiceParticipantMenuData.tsx+++ b/fluxer_app/src/features/ui/action_menu/items/VoiceParticipantMenuData.tsx@@ -43,7 +43,7 @@ import {useRoleHierarchy} from '@app/features/permissions/hooks/useRoleHierarchyimport Permission from '@app/features/permissions/state/Permission';import * as PermissionUtils from '@app/features/permissions/utils/PermissionUtils';import {Logger} from '@app/features/platform/utils/AppLogger';-import {ComponentDispatch} from '@app/features/platform/utils/ComponentBus';+import {ComponentBus} from '@app/features/platform/utils/ComponentBus';import {ChangeFriendNicknameModal} from '@app/features/relationship/components/modals/ChangeFriendNicknameModal';import Relationships from '@app/features/relationship/state/Relationships';import * as RelationshipActionUtils from '@app/features/relationship/utils/RelationshipActionUtils';@@ -601,7 +601,7 @@ export function useVoiceParticipantMenuData(options: VoiceParticipantMenuDataOptlabel: i18n._(MENTION_DESCRIPTOR),onClick: () => {onClose();- ComponentDispatch.dispatch('INSERT_MENTION', {userId: user.id});+ ComponentBus.dispatch('INSERT_MENTION', {userId: user.id});},});}diff --git a/fluxer_app/src/features/ui/popover/PopoverPopout.tsx b/fluxer_app/src/features/ui/popover/PopoverPopout.tsxindex 2448c8c8a..183e2ecf1 100644--- a/fluxer_app/src/features/ui/popover/PopoverPopout.tsx+++ b/fluxer_app/src/features/ui/popover/PopoverPopout.tsx@@ -3,7 +3,7 @@import {useMergeRefs} from '@app/features/app/hooks/useMergeRefs';import {isKeyboardActivationKey} from '@app/features/input/utils/KeyboardUtils';import type {ComponentActionType} from '@app/features/platform/utils/ComponentBus';-import {ComponentDispatch} from '@app/features/platform/utils/ComponentBus';+import {ComponentBus} from '@app/features/platform/utils/ComponentBus';import * as PopoutCommands from '@app/features/ui/commands/PopoutCommands';import {type PopoutAnimationType,@@ -373,8 +373,8 @@ export const Popout = React.forwardRef<HTMLElement, PopoutProps>((props, ref) =>useEffect(() => {if (!props.subscribeTo) return;const handler = () => toggle();- ComponentDispatch.subscribe(props.subscribeTo, handler);- return () => ComponentDispatch.unsubscribe(props.subscribeTo!, handler);+ ComponentBus.subscribe(props.subscribeTo, handler);+ return () => ComponentBus.unsubscribe(props.subscribeTo!, handler);}, [props.subscribeTo, toggle]);const childToRender =(props.children as React.ReactNode) || (!props.closeOnChildrenUnmount ? state.lastValidChildren : null);diff --git a/fluxer_app/src/features/user/components/modals/UserSettingsModal.tsx b/fluxer_app/src/features/user/components/modals/UserSettingsModal.tsxindex 55bd081d6..bf4bca1d6 100644--- a/fluxer_app/src/features/user/components/modals/UserSettingsModal.tsx+++ b/fluxer_app/src/features/user/components/modals/UserSettingsModal.tsx@@ -5,7 +5,7 @@ import {MobileSettingsView} from '@app/features/app/components/dialogs/componentimport * as Modal from '@app/features/app/components/dialogs/Modal';import {SettingsModalContainer} from '@app/features/app/components/dialogs/shared/SettingsModalLayout';import DeveloperOptions from '@app/features/devtools/state/DeveloperOptions';-import {ComponentDispatch} from '@app/features/platform/utils/ComponentBus';+import {ComponentBus} from '@app/features/platform/utils/ComponentBus';import * as ModalCommands from '@app/features/ui/commands/ModalCommands';import * as UnsavedChangesCommands from '@app/features/ui/commands/UnsavedChangesCommands';import MobileLayout from '@app/features/ui/state/MobileLayout';@@ -141,7 +141,7 @@ export const UserSettingsModal: React.FC<UserSettingsModalProps> = observer(}}, [resolveVisibleTab, selectedTab]);useEffect(() => {- const unsubscribe = ComponentDispatch.subscribe('USER_SETTINGS_TAB_SELECT', (args?: unknown) => {+ const unsubscribe = ComponentBus.subscribe('USER_SETTINGS_TAB_SELECT', (args?: unknown) => {const {tab, section} = (args ?? {}) as {tab?: string; section?: string};if (tab && typeof tab === 'string') {const accountSection =diff --git a/fluxer_app/src/features/user/components/modals/tabs/AdvancedSettingsTab.tsx b/fluxer_app/src/features/user/components/modals/tabs/AdvancedSettingsTab.tsxindex 0d07d2eb5..a2b5a4bd8 100644--- a/fluxer_app/src/features/user/components/modals/tabs/AdvancedSettingsTab.tsx+++ b/fluxer_app/src/features/user/components/modals/tabs/AdvancedSettingsTab.tsx@@ -3,7 +3,7 @@import {SettingsSearch} from '@app/features/app/components/dialogs/components/SettingsSearch';import {SettingsHeadingLinkButton} from '@app/features/app/components/dialogs/shared/SettingsHeadingLinkButton';import {SettingsTabContainer, SettingsTabContent} from '@app/features/app/components/dialogs/shared/SettingsTabLayout';-import {ComponentDispatch} from '@app/features/platform/utils/ComponentBus';+import {ComponentBus} from '@app/features/platform/utils/ComponentBus';import styles from '@app/features/user/components/modals/tabs/AdvancedSettingsTab.module.css';import {AdvancedSettingRow} from '@app/features/user/components/modals/tabs/advanced_settings_tab/AdvancedSettingRow';import {@@ -80,7 +80,7 @@ export const AdvancedSettingsTab = observer(() => {const groups = useMemo(() => groupAdvancedItemsByCategory(remainingItems, tagLabels), [remainingItems, tagLabels]);const showGroupLinks = groups.length > 1;const handleOpenSource = useCallback((item: SearchableSettingItem) => {- ComponentDispatch.dispatch('USER_SETTINGS_TAB_SELECT', {+ ComponentBus.dispatch('USER_SETTINGS_TAB_SELECT', {tab: getAdvancedSettingSourceTab(item),section: getAdvancedSettingSourceSection(item),});diff --git a/fluxer_app/src/features/user/components/modals/tabs/ExpressionPacksTab.tsx b/fluxer_app/src/features/user/components/modals/tabs/ExpressionPacksTab.tsxindex 3fcd84c72..fe3c127ca 100644--- a/fluxer_app/src/features/user/components/modals/tabs/ExpressionPacksTab.tsx+++ b/fluxer_app/src/features/user/components/modals/tabs/ExpressionPacksTab.tsx@@ -13,7 +13,7 @@ import {EditPackModal} from '@app/features/expressions/components/modals/EditPacimport {PackInviteModal} from '@app/features/expressions/components/modals/PackInviteModal';import Packs from '@app/features/expressions/state/ExpressionsPacks';import {NO_DESCRIPTION_PROVIDED_DESCRIPTOR} from '@app/features/i18n/utils/CommonMessageDescriptors';-import {ComponentDispatch} from '@app/features/platform/utils/ComponentBus';+import {ComponentBus} from '@app/features/platform/utils/ComponentBus';import {Button} from '@app/features/ui/button/Button';import * as ModalCommands from '@app/features/ui/commands/ModalCommands';import {modal} from '@app/features/ui/commands/ModalCommands';@@ -189,7 +189,7 @@ const ExpressionPacksTab: React.FC = observer(() => {actions={[{text: i18n._(LEARN_ABOUT_PREMIUM_DESCRIPTOR, {premiumProductName: PREMIUM_PRODUCT_NAME}),- onClick: () => ComponentDispatch.dispatch('USER_SETTINGS_TAB_SELECT', {tab: 'plutonium'}),+ onClick: () => ComponentBus.dispatch('USER_SETTINGS_TAB_SELECT', {tab: 'plutonium'}),variant: 'primary',fitContent: true,},diff --git a/fluxer_app/src/features/user/components/modals/tabs/GiftInventoryTab.tsx b/fluxer_app/src/features/user/components/modals/tabs/GiftInventoryTab.tsxindex 66b2621d5..915731877 100644--- a/fluxer_app/src/features/user/components/modals/tabs/GiftInventoryTab.tsx+++ b/fluxer_app/src/features/user/components/modals/tabs/GiftInventoryTab.tsx@@ -18,7 +18,7 @@ import {TRY_AGAIN_IN_A_MOMENT_DESCRIPTOR,} from '@app/features/i18n/utils/CommonMessageDescriptors';import {Logger} from '@app/features/platform/utils/AppLogger';-import {ComponentDispatch} from '@app/features/platform/utils/ComponentBus';+import {ComponentBus} from '@app/features/platform/utils/ComponentBus';import {remFromPx} from '@app/features/theme/layout/RemFromPx';import {Button} from '@app/features/ui/button/Button';import * as ModalCommands from '@app/features/ui/commands/ModalCommands';@@ -445,7 +445,7 @@ const GiftInventoryTab: React.FC = observer(() => {actions={[{text: i18n._(GO_TO_PREMIUM_DESCRIPTOR, {premiumProductName: PREMIUM_PRODUCT_NAME}),- onClick: () => ComponentDispatch.dispatch('USER_SETTINGS_TAB_SELECT', {tab: 'plutonium'}),+ onClick: () => ComponentBus.dispatch('USER_SETTINGS_TAB_SELECT', {tab: 'plutonium'}),variant: 'primary',fitContent: true,},diff --git a/fluxer_app/src/features/user/components/modals/tabs/UserVideoTab.tsx b/fluxer_app/src/features/user/components/modals/tabs/UserVideoTab.tsxindex a61723bf4..f35767bcc 100644--- a/fluxer_app/src/features/user/components/modals/tabs/UserVideoTab.tsx+++ b/fluxer_app/src/features/user/components/modals/tabs/UserVideoTab.tsx@@ -11,7 +11,7 @@ import RuntimeConfig from '@app/features/app/state/RuntimeConfig';import {LimitResolver} from '@app/features/app/utils/LimitResolverAdapter';import {isLimitToggleEnabled} from '@app/features/app/utils/LimitUtils';import {GET_PREMIUM_DESCRIPTOR} from '@app/features/i18n/utils/CommonMessageDescriptors';-import {ComponentDispatch} from '@app/features/platform/utils/ComponentBus';+import {ComponentBus} from '@app/features/platform/utils/ComponentBus';import * as PremiumModalCommands from '@app/features/premium/commands/PremiumModalCommands';import {remFromPx} from '@app/features/theme/layout/RemFromPx';import {Button} from '@app/features/ui/button/Button';@@ -198,7 +198,7 @@ export const VideoTab: React.FC<VideoTabProps> = observer(VoiceSettingsCommands.update({videoFrameRate: value, streamingMode: 'custom'});}, []);const handleOpenAdvancedVideoSettings = useCallback(() => {- ComponentDispatch.dispatch('USER_SETTINGS_TAB_SELECT', {+ ComponentBus.dispatch('USER_SETTINGS_TAB_SELECT', {tab: 'advanced_settings',section: getAdvancedSettingsCategorySectionId('media'),});diff --git a/fluxer_app/src/features/user/components/modals/tabs/components/CodecSelectorSection.tsx b/fluxer_app/src/features/user/components/modals/tabs/components/CodecSelectorSection.tsxindex da0185d3b..75d8f63c8 100644--- a/fluxer_app/src/features/user/components/modals/tabs/components/CodecSelectorSection.tsx+++ b/fluxer_app/src/features/user/components/modals/tabs/components/CodecSelectorSection.tsx@@ -4,7 +4,7 @@ import {getCachedDesktopTroubleshootingSettings,getDesktopTroubleshootingSettings,} from '@app/features/devtools/utils/DesktopTroubleshootingUtils';-import {ComponentDispatch} from '@app/features/platform/utils/ComponentBus';+import {ComponentBus} from '@app/features/platform/utils/ComponentBus';import type {RadioOption} from '@app/features/ui/radio_group/RadioGroup';import {RadioGroup} from '@app/features/ui/radio_group/RadioGroup';import {isDesktop} from '@app/features/ui/utils/NativeUtils';@@ -114,7 +114,7 @@ export const CodecSelectorSection = observer(() => {}, []);const openAdvancedSettingsTab = useCallback((event: React.MouseEvent<HTMLButtonElement>) => {event.preventDefault();- ComponentDispatch.dispatch('USER_SETTINGS_TAB_SELECT', {tab: 'advanced_settings'});+ ComponentBus.dispatch('USER_SETTINGS_TAB_SELECT', {tab: 'advanced_settings'});}, []);const hardwareAccelOff = isDesktopClient && hardwareAccelDisabled === true;return (diff --git a/fluxer_app/src/features/user/components/modals/tabs/notifications_tab/TextToSpeech.tsx b/fluxer_app/src/features/user/components/modals/tabs/notifications_tab/TextToSpeech.tsxindex 2f653b139..ac8dd2c22 100644--- a/fluxer_app/src/features/user/components/modals/tabs/notifications_tab/TextToSpeech.tsx+++ b/fluxer_app/src/features/user/components/modals/tabs/notifications_tab/TextToSpeech.tsx@@ -2,7 +2,7 @@import * as AccessibilityCommands from '@app/features/accessibility/commands/AccessibilityCommands';import Accessibility from '@app/features/accessibility/state/Accessibility';-import {ComponentDispatch} from '@app/features/platform/utils/ComponentBus';+import {ComponentBus} from '@app/features/platform/utils/ComponentBus';import {remFromPx} from '@app/features/theme/layout/RemFromPx';import {Switch} from '@app/features/ui/components/form/FormSwitch';import {RadioGroup, type RadioOption} from '@app/features/ui/radio_group/RadioGroup';@@ -64,7 +64,7 @@ export const TextToSpeech = observer(() => {AccessibilityCommands.update({enableTTSCommand: value});}, []);const handleAccessibilityLinkClick = useCallback(() => {- ComponentDispatch.dispatch('USER_SETTINGS_TAB_SELECT', {tab: 'accessibility', section: 'tts'});+ ComponentBus.dispatch('USER_SETTINGS_TAB_SELECT', {tab: 'accessibility', section: 'tts'});}, []);const ttsNotificationMode = Notification.getTTSNotificationMode();const ttsNotificationOptions: Array<RadioOption<TTSNotificationMode>> = [