Fix the mechanical lint groups and delete the unused bindings. [skip build]
Checks / checks (push) Successful in 2m12s
Trigger cinny-mobile / dispatch (push) Successful in 2s

This commit is contained in:
2026-11-01 20:31:21 +11:00
parent 593dd3bdf3
commit 5477242661
26 changed files with 95 additions and 161 deletions
@@ -23,19 +23,6 @@ interface IncomingCall {
startTime: number;
}
/**
* Checks if a room is a DM or small group (not a server/space room)
* @param room - The Matrix room to check
* @returns true if the room is a DM or small group
*/
function isDirectOrSmallGroup(room: Room): boolean {
if (room.isSpaceRoom()) {
return false;
}
const memberCount = room.getJoinedMemberCount();
return memberCount <= 10;
}
/**
* Gets active call members from a room who are NOT the current user
* Also returns the earliest call start time
+1 -8
View File
@@ -246,14 +246,7 @@ export function useCallService(): CallContextValue {
* Hook to check if a call is active in a specific room
*/
export function useRoomCall(roomId: string) {
const {
activeCall,
startCall,
endCall,
callSupported: globalCallSupported,
callSupportLoading: globalCallSupportLoading,
callService,
} = useCall();
const { activeCall, startCall, endCall, callService } = useCall();
const mx = useMatrixClient();
const [roomCallSupported, setRoomCallSupported] = useState(false);
const [roomCallSupportLoading, setRoomCallSupportLoading] = useState(true);
+5 -8
View File
@@ -54,14 +54,11 @@ export function ForumBoardDetail() {
[threads, selectedPostId],
);
const handleReplySent = useCallback(
(_reply: ForumPost) => {
if (selectedPostId) {
recordThreadReply(selectedPostId);
}
},
[recordThreadReply, selectedPostId],
);
const handleReplySent = useCallback(() => {
if (selectedPostId) {
recordThreadReply(selectedPostId);
}
}, [recordThreadReply, selectedPostId]);
const showThread = Boolean(selectedPostId && activeTopicRoom);
const threadInitialPost = optimisticPost?.eventId === selectedPostId ? optimisticPost : null;
@@ -42,7 +42,6 @@ export function ForumBoardView({ forumSpace, scope }: ForumBoardViewProps) {
hasMorePosts,
loadingMore,
insertThreadFromNewPost,
recordThreadReply,
} = useForumBoard(scope, forumSpace);
const activeTopicRoom = activeTopicRoomId ? mx.getRoom(activeTopicRoomId) : null;
+5 -8
View File
@@ -86,14 +86,11 @@ export function ForumSpaceShell() {
[insertThreadFromNewPost, selectPost],
);
const handleReplySent = useCallback(
(_reply: ForumPost) => {
if (selectedPostId) {
recordThreadReply(selectedPostId);
}
},
[recordThreadReply, selectedPostId],
);
const handleReplySent = useCallback(() => {
if (selectedPostId) {
recordThreadReply(selectedPostId);
}
}, [recordThreadReply, selectedPostId]);
const showThread = Boolean(selectedPostId && activeTopicRoom);
+1 -1
View File
@@ -342,7 +342,7 @@ export function RoomNavItem({
const rootBody = rootEvent.getContent()?.body ?? '';
return rootBody;
} catch (error) {
} catch {
return undefined;
}
}, [room]);
+1 -7
View File
@@ -94,12 +94,7 @@ import {
getImageMsgContent,
getVideoMsgContent,
} from './msgContent';
import {
getMemberDisplayName,
getMentionContent,
trimReplyFromBody,
getMemberAvatarMxc,
} from '../../utils/room';
import { getMemberDisplayName, getMentionContent, trimReplyFromBody } from '../../utils/room';
import { CommandAutocomplete } from './CommandAutocomplete';
import { Command, SHRUG, TABLEFLIP, UNFLIP, useCommands } from '../../hooks/useCommands';
import { pluginRegistry } from '../settings/plugins/PluginAPI';
@@ -183,7 +178,6 @@ export const RoomInput = forwardRef<HTMLDivElement, RoomInputProps>(
const [msgDraft, setMsgDraft] = useAtom(roomIdToMsgDraftAtomFamily(roomId));
const [replyDraft, setReplyDraft] = useAtom(roomIdToReplyDraftAtomFamily(roomId));
const replyUserID = replyDraft?.userId;
const replyAvatarMxc = replyUserID ? getMemberAvatarMxc(room, replyUserID) : undefined;
const powerLevelTags = usePowerLevelTags(room, powerLevels);
const creatorsTag = useRoomCreatorsTag();
-3
View File
@@ -528,9 +528,6 @@ export function RoomViewHeader({ forumLayout = false }: RoomViewHeaderProps) {
: undefined;
const dmUserId = isDirect ? guessDmRoomUserId(room, mx.getSafeUserId()) : undefined;
const dmAvatarMxc =
(dmUserId ? room.getMember(dmUserId)?.getMxcAvatarUrl() : undefined) ||
(isDirect ? avatarMxc : undefined);
const dmCustomColor = useOtherUserColor(dmUserId ?? '');
const dmFolderTabColor =
stationery && isDirect
@@ -495,6 +495,5 @@ export function sampleBurstAngle(profile: EmojiBurstProfile): number {
}
const bias = profile.angleBias ?? -Math.PI / 2;
const halfSpread = profile.angleSpread / 2;
return bias + (Math.random() - 0.5) * profile.angleSpread * (0.6 + Math.random() * 0.4);
}
+6 -10
View File
@@ -11,7 +11,6 @@ import { useMediaAuthentication } from '../../../hooks/useMediaAuthentication';
import { useAuthenticatedMediaUrl } from '../../../hooks/useAuthenticatedMediaUrl';
import { getTextShadowColor } from '../../../utils/common';
import { useFilePicker } from '../../../hooks/useFilePicker';
import { useObjectURL } from '../../../hooks/useObjectURL';
import { createUploadAtom, UploadSuccess } from '../../../state/upload';
import { CompactUploadCardRenderer } from '../../../components/upload-card';
import { useUserColorPreference } from '../../../hooks/useUserColor';
@@ -51,7 +50,7 @@ function ProfileBanner({
const userId = mx.getUserId()!;
const profile = useUserProfile(userId);
const presence = useUserPresence(userId);
const [userBanner, setUserBanner, loading] = useUserBanner();
const [userBanner, setUserBanner] = useUserBanner();
const [collectibles, updateCollectible] = useUserCollectibles();
const [saving, setSaving] = useState(false);
const [error, setError] = useState<string>();
@@ -118,7 +117,7 @@ function ProfileBanner({
setColorError(undefined);
try {
await setColorPreference({ on_dark: localOnDark, on_light: localOnLight });
} catch (e) {
} catch {
setColorError('Failed to save colors. Your server may not support profile fields (MSC4133).');
}
setSavingColor(false);
@@ -131,7 +130,7 @@ function ProfileBanner({
await setColorPreference(undefined);
setLocalOnDark('#ffd9f5');
setLocalOnLight('#440000');
} catch (e) {
} catch {
setColorError('Failed to remove colors');
}
setSavingColor(false);
@@ -157,7 +156,7 @@ function ProfileBanner({
setVerbError(undefined);
try {
await setTypingVerb(parsed);
} catch (e) {
} catch {
setVerbError('Failed to save typing verb. Server may not support profile fields (MSC4133).');
}
setSavingVerb(false);
@@ -169,7 +168,7 @@ function ProfileBanner({
try {
await setTypingVerb(undefined);
setLocalVerb('');
} catch (e) {
} catch {
setVerbError('Failed to remove typing verb');
}
setSavingVerb(false);
@@ -330,7 +329,6 @@ function ProfileBanner({
}, [mx, useAuthentication, userBanner, refreshTrigger]);
const [imageFile, setImageFile] = useState<File>();
const imageFileURL = useObjectURL(imageFile);
const uploadAtom = useMemo(() => {
if (imageFile) return createUploadAtom(imageFile);
return undefined;
@@ -414,7 +412,7 @@ function ProfileBanner({
await setUserBanner(undefined);
// Sync user object to propagate changes throughout app
await syncUserAvatar();
} catch (e) {
} catch {
setError('Failed to remove banner.');
}
setSaving(false);
@@ -1209,8 +1207,6 @@ function ProfileBanner({
}
export function Profile() {
const mx = useMatrixClient();
const userId = mx.getUserId()!;
const avatarRef = useRef<HTMLDivElement>(null);
const nameRef = useRef<HTMLDivElement>(null);
@@ -315,7 +315,9 @@ function AndroidPushNotifications() {
radii="300"
variant="Secondary"
disabled={isBusy}
onClick={() => void reset()}
onClick={() => {
reset();
}}
>
{resetState.status === AsyncStatus.Loading ? (
<Spinner variant="Secondary" size="200" />
@@ -334,7 +336,9 @@ function AndroidPushNotifications() {
radii="300"
variant="Secondary"
disabled={isBusy}
onClick={() => void ping()}
onClick={() => {
ping();
}}
>
{pingState.status === AsyncStatus.Loading ? (
<Spinner variant="Secondary" size="200" />
+37 -37
View File
@@ -242,6 +242,43 @@ function SettingRenderer({
return null;
}
function PluginAvatar({ thumbnail, name }: { thumbnail: string; name: string }) {
const [imageError, setImageError] = useState(false);
return (
<Avatar size="500" radii="400">
{!imageError ? (
<img
src={thumbnail}
alt={name}
style={{
width: '100%',
height: '100%',
objectFit: 'cover',
borderRadius: 'inherit',
}}
onError={() => setImageError(true)}
/>
) : (
<Box
justifyContent="Center"
alignItems="Center"
style={{
width: '100%',
height: '100%',
background: `linear-gradient(135deg, ${color.Secondary.Container} 0%, ${color.Primary.Container} 100%)`,
borderRadius: 'inherit',
}}
>
<Text size="H3" priority="300" style={{ fontWeight: 600 }}>
{name.charAt(0).toUpperCase()}
</Text>
</Box>
)}
</Avatar>
);
}
type PluginsProps = {
requestClose: () => void;
};
@@ -346,43 +383,6 @@ export function Plugins({ requestClose }: PluginsProps) {
[installedPlugins],
);
function PluginAvatar({ thumbnail, name }: { thumbnail: string; name: string }) {
const [imageError, setImageError] = useState(false);
return (
<Avatar size="500" radii="400">
{!imageError ? (
<img
src={thumbnail}
alt={name}
style={{
width: '100%',
height: '100%',
objectFit: 'cover',
borderRadius: 'inherit',
}}
onError={() => setImageError(true)}
/>
) : (
<Box
justifyContent="Center"
alignItems="Center"
style={{
width: '100%',
height: '100%',
background: `linear-gradient(135deg, ${color.Secondary.Container} 0%, ${color.Primary.Container} 100%)`,
borderRadius: 'inherit',
}}
>
<Text size="H3" priority="300" style={{ fontWeight: 600 }}>
{name.charAt(0).toUpperCase()}
</Text>
</Box>
)}
</Avatar>
);
}
const filteredMarketplacePlugins = useMemo(() => {
if (!searchQuery.trim()) return marketplacePlugins;
return fuzzyFilter(marketplacePlugins, searchQuery, (plugin) => [
@@ -200,7 +200,9 @@ export function Permissions({ requestClose }: PermissionsProps) {
// Add a small delay to avoid rate limiting
if (completed < total) {
await new Promise((resolve) => setTimeout(resolve, 100));
await new Promise((resolve) => {
setTimeout(resolve, 100);
});
}
}
} catch (error) {
@@ -297,7 +299,9 @@ export function Permissions({ requestClose }: PermissionsProps) {
// Add a small delay to avoid rate limiting
if (completed < total) {
await new Promise((resolve) => setTimeout(resolve, 100));
await new Promise((resolve) => {
setTimeout(resolve, 100);
});
}
}
} catch (error) {
@@ -325,7 +329,6 @@ export function Permissions({ requestClose }: PermissionsProps) {
return <PowersEditor powerLevels={powerLevels} requestClose={() => setPowerEditor(false)} />;
}
const hasSyncableChildren = allChildren.length > 0;
const isSyncing = syncState.status === AsyncStatus.Loading;
const syncSuccess = syncState.status === AsyncStatus.Success;
const syncError = syncState.status === AsyncStatus.Error;