Skip to content

A free and open source instant messaging and VoIP chat app built for friends, groups, and communities.

TypeScript fluxerfluxerapp

refactor(app): unexport file-local thread and message values

Hampusc9c172c35ca2
diff --git a/fluxer_app/src/features/channel/components/channel_search_results/ChannelSearchResultsShared.tsx b/fluxer_app/src/features/channel/components/channel_search_results/ChannelSearchResultsShared.tsx
index 6e43e1081..7471fb1d7 100644
--- a/fluxer_app/src/features/channel/components/channel_search_results/ChannelSearchResultsShared.tsx
+++ b/fluxer_app/src/features/channel/components/channel_search_results/ChannelSearchResultsShared.tsx
@@ -56,7 +56,7 @@ const SEARCH_RESULTS_DESCRIPTOR = msg({
message: 'Search results',
comment: 'Default header title in the channel search results panel before a query has been submitted.',
});
-export const AN_ERROR_OCCURRED_WHILE_SEARCHING_DESCRIPTOR = msg({
+const AN_ERROR_OCCURRED_WHILE_SEARCHING_DESCRIPTOR = msg({
message: 'An error occurred while searching.',
comment: 'Fallback error message shown when the channel search request fails for an unknown reason.',
});
diff --git a/fluxer_app/src/features/forum/components/ForumPostContextMenu.tsx b/fluxer_app/src/features/forum/components/ForumPostContextMenu.tsx
index a3312d79c..9c136a5e3 100644
--- a/fluxer_app/src/features/forum/components/ForumPostContextMenu.tsx
+++ b/fluxer_app/src/features/forum/components/ForumPostContextMenu.tsx
@@ -21,7 +21,7 @@ import {PushPinSimpleIcon, PushPinSimpleSlashIcon, TagIcon} from '@phosphor-icon
import {observer} from 'mobx-react-lite';
import type React from 'react';
-export function openForumPostTagsModal(post: Channel): void {
+function openForumPostTagsModal(post: Channel): void {
ModalCommands.push(
modal(() => (
<ForumPostTagsModal
diff --git a/fluxer_app/src/features/forum/utils/ForumPostList.ts b/fluxer_app/src/features/forum/utils/ForumPostList.ts
index 4a816f4bf..e2c7761e6 100644
--- a/fluxer_app/src/features/forum/utils/ForumPostList.ts
+++ b/fluxer_app/src/features/forum/utils/ForumPostList.ts
@@ -15,11 +15,11 @@ export function isPinnedPost(post: Channel): boolean {
return (post.flags & ChannelFlags.PINNED) !== 0;
}
-export function postSortKey(post: Channel, sortOrder: ForumSortOrderType): string {
+function postSortKey(post: Channel, sortOrder: ForumSortOrderType): string {
return sortOrder === ForumSortOrderTypes.CREATION_TIME ? post.id : lastActivityId(post);
}
-export function matchesTagFilter(
+function matchesTagFilter(
appliedTags: ReadonlyArray<string>,
tagIds: ReadonlyArray<string>,
tagSetting: ForumTagSetting,
diff --git a/fluxer_app/src/features/messaging/state/ReactionStateMachine.ts b/fluxer_app/src/features/messaging/state/ReactionStateMachine.ts
index aa1ca5a92..2a4dee2ef 100644
--- a/fluxer_app/src/features/messaging/state/ReactionStateMachine.ts
+++ b/fluxer_app/src/features/messaging/state/ReactionStateMachine.ts
@@ -3,7 +3,7 @@
import type {ReactionEmoji} from '@app/features/messaging/utils/ReactionUtils';
import type {MessageReaction} from '@fluxer/schema/src/domains/message/MessageResponseSchemas';
-export interface ReactionRecord {
+interface ReactionRecord {
emoji: ReactionEmoji;
count: number;
me: boolean;
@@ -29,7 +29,7 @@ export function getEmojiKey(emoji: ReactionEmoji): string {
return `${emoji.id ?? ''}:${emoji.name}`;
}
-export function sameEmoji(left: ReactionEmoji, right: ReactionEmoji): boolean {
+function sameEmoji(left: ReactionEmoji, right: ReactionEmoji): boolean {
return (left.id ?? null) === (right.id ?? null) && left.name === right.name;
}
diff --git a/fluxer_app/src/features/messaging/utils/ExternalLinkUtils.tsx b/fluxer_app/src/features/messaging/utils/ExternalLinkUtils.tsx
index a4f9323ac..e88e9f603 100644
--- a/fluxer_app/src/features/messaging/utils/ExternalLinkUtils.tsx
+++ b/fluxer_app/src/features/messaging/utils/ExternalLinkUtils.tsx
@@ -21,7 +21,7 @@ export function isTrustedExternalUrl(url: string): boolean {
}
}
-export function openUrlInBrowserWithWarning(url: string): void {
+function openUrlInBrowserWithWarning(url: string): void {
const target = unwrapDesktopLocalResourceURL(url);
if (isTrustedExternalUrl(target)) {
void openExternalUrl(target);
diff --git a/fluxer_app/src/features/threads/components/ThreadMembersPanel.tsx b/fluxer_app/src/features/threads/components/ThreadMembersPanel.tsx
index 38730424d..dd90092cb 100644
--- a/fluxer_app/src/features/threads/components/ThreadMembersPanel.tsx
+++ b/fluxer_app/src/features/threads/components/ThreadMembersPanel.tsx
@@ -25,7 +25,7 @@ import {useLingui} from '@lingui/react/macro';
import {observer} from 'mobx-react-lite';
import {useEffect} from 'react';
-export function useThreadRosterSubscription(thread: Channel | undefined): void {
+function useThreadRosterSubscription(thread: Channel | undefined): void {
const guildId = thread?.guildId;
const threadId = thread?.id;
useEffect(() => {
@@ -61,6 +61,7 @@ const RosterGroup = observer(({id, guildRole, label, members, thread, ownerId}:
name={label}
count={members.length}
className={styles.groupHeader}
+ data-flx="threads.thread-members-panel.roster-group.group-header"
/>
<div className={styles.membersList} data-flx="threads.thread-members-panel.roster-group.members-list">
{members.map(({user, member, status, mobile, customStatus}) => (
diff --git a/fluxer_app/src/features/threads/hooks/useThreadMenuData.tsx b/fluxer_app/src/features/threads/hooks/useThreadMenuData.tsx
index 9c502f8a7..9a6d3d612 100644
--- a/fluxer_app/src/features/threads/hooks/useThreadMenuData.tsx
+++ b/fluxer_app/src/features/threads/hooks/useThreadMenuData.tsx
@@ -68,7 +68,7 @@ function run(i18n: I18n, action: () => Promise<void>): void {
void action().catch((error) => reportThreadActionError(i18n, error));
}
-export function openThreadSettings(thread: Channel): void {
+function openThreadSettings(thread: Channel): void {
ModalCommands.push(
modal(() => (
<ThreadSettingsModal threadId={thread.id} data-flx="threads.use-thread-menu-data.thread-settings-modal" />
@@ -76,7 +76,7 @@ export function openThreadSettings(thread: Channel): void {
);
}
-export function confirmDeleteThread(i18n: I18n, thread: Channel): void {
+function confirmDeleteThread(i18n: I18n, thread: Channel): void {
ModalCommands.push(
modal(() => (
<ConfirmModal
diff --git a/fluxer_app/src/features/threads/hooks/useThreadSearch.ts b/fluxer_app/src/features/threads/hooks/useThreadSearch.ts
index a13abd116..fe0a79dd0 100644
--- a/fluxer_app/src/features/threads/hooks/useThreadSearch.ts
+++ b/fluxer_app/src/features/threads/hooks/useThreadSearch.ts
@@ -6,7 +6,7 @@ import {searchRetryDelayMs} from '@app/features/forum/state/ForumPosts';
import * as ThreadCommands from '@app/features/threads/commands/ThreadCommands';
import {useCallback, useEffect, useState} from 'react';
-export const THREAD_SEARCH_DEBOUNCE_MS = 300;
+const THREAD_SEARCH_DEBOUNCE_MS = 300;
const MAX_INDEX_RETRIES = 6;
export type ThreadSearchState =
diff --git a/fluxer_app/src/features/threads/utils/ThreadActionRules.ts b/fluxer_app/src/features/threads/utils/ThreadActionRules.ts
index b62603d2c..cea07abc4 100644
--- a/fluxer_app/src/features/threads/utils/ThreadActionRules.ts
+++ b/fluxer_app/src/features/threads/utils/ThreadActionRules.ts
@@ -48,7 +48,7 @@ function actorFor(guildId: string | undefined, permissions: bigint): ThreadActor
};
}
-export function getParentActor(parent: Channel): ThreadActor {
+function getParentActor(parent: Channel): ThreadActor {
return actorFor(parent.guildId, Permission.getChannelPermissions(parent.id) ?? 0n);
}
diff --git a/fluxer_app/src/features/threads/utils/ThreadNotificationUtils.ts b/fluxer_app/src/features/threads/utils/ThreadNotificationUtils.ts
index 83ab1e34e..b83c7d692 100644
--- a/fluxer_app/src/features/threads/utils/ThreadNotificationUtils.ts
+++ b/fluxer_app/src/features/threads/utils/ThreadNotificationUtils.ts
@@ -20,7 +20,7 @@ export function getThreadParent(thread: Channel): Channel | undefined {
return thread.parentId ? Channels.getChannel(thread.parentId) : undefined;
}
-export function isThreadParentMuted(thread: Channel): boolean {
+function isThreadParentMuted(thread: Channel): boolean {
return thread.parentId != null && UserGuildSettings.isMutedAtAnyLevel(thread.guildId ?? null, thread.parentId);
}
diff --git a/fluxer_app/src/features/threads/utils/ThreadStarterSend.ts b/fluxer_app/src/features/threads/utils/ThreadStarterSend.ts
index c38f02f41..b7c5b51a3 100644
--- a/fluxer_app/src/features/threads/utils/ThreadStarterSend.ts
+++ b/fluxer_app/src/features/threads/utils/ThreadStarterSend.ts
@@ -45,7 +45,7 @@ export function sendThreadStarter(thread: Channel, payload: ThreadStarterPayload
});
}
-export function useCooldownSeconds(until: number): number {
+function useCooldownSeconds(until: number): number {
const [now, setNow] = useState(() => Date.now());
useEffect(() => {
if (until <= Date.now()) return;