Fix the single-violation style findings. [skip build]

This commit is contained in:
2026-11-01 05:31:04 +11:00
parent b158648fc4
commit 0f60822cec
7 changed files with 16 additions and 14 deletions
@@ -30,7 +30,7 @@ AuthenticatedMedia.displayName = 'AuthenticatedMedia';
* A simpler authenticated img component for use in places like custom HTML parsers. * A simpler authenticated img component for use in places like custom HTML parsers.
* This component handles its own authentication state. * This component handles its own authentication state.
*/ */
export interface AuthenticatedImgProps extends ImgHTMLAttributes<HTMLImageElement> {} export type AuthenticatedImgProps = ImgHTMLAttributes<HTMLImageElement>;
export const AuthenticatedImg = forwardRef<HTMLImageElement, AuthenticatedImgProps>( export const AuthenticatedImg = forwardRef<HTMLImageElement, AuthenticatedImgProps>(
({ src, ...props }, ref) => { ({ src, ...props }, ref) => {
@@ -108,7 +108,6 @@ export const TikTokEmbedContainer = style([
{ {
width: '100%', width: '100%',
height: toRem(550), height: toRem(550),
display: 'flex',
alignItems: 'center', alignItems: 'center',
justifyContent: 'center', justifyContent: 'center',
backgroundColor: '#000', backgroundColor: '#000',
@@ -1,4 +1,4 @@
import React, { createContext, useContext } from 'react'; import React, { createContext, useContext, useMemo } from 'react';
import { RectCords } from 'folds'; import { RectCords } from 'folds';
type ForumMessageMenuContextValue = { type ForumMessageMenuContextValue = {
@@ -14,10 +14,10 @@ export function ForumMessageMenuProvider({
openMenu: (anchor: RectCords) => void; openMenu: (anchor: RectCords) => void;
children: React.ReactNode; children: React.ReactNode;
}) { }) {
const value = useMemo(() => ({ openMenu }), [openMenu]);
return ( return (
<ForumMessageMenuContext.Provider value={{ openMenu }}> <ForumMessageMenuContext.Provider value={value}>{children}</ForumMessageMenuContext.Provider>
{children}
</ForumMessageMenuContext.Provider>
); );
} }
+1 -1
View File
@@ -37,7 +37,7 @@ const CROWN: SvgNode[] = [
]; ];
function lucideIcon(nodes: SvgNode): IconSrc { function lucideIcon(nodes: SvgNode): IconSrc {
return function () { return function Icon() {
return ( return (
<svg <svg
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
@@ -111,6 +111,8 @@ export function DeveloperTools({ requestClose }: DeveloperToolsProps) {
[mx], [mx],
); );
const closeProfileField = useCallback(() => setProfileFieldKey(undefined), []);
if (accountDataType !== undefined) { if (accountDataType !== undefined) {
return ( return (
<AccountDataEditor <AccountDataEditor
@@ -122,8 +124,6 @@ export function DeveloperTools({ requestClose }: DeveloperToolsProps) {
); );
} }
const closeProfileField = useCallback(() => setProfileFieldKey(undefined), []);
return ( return (
<Page> <Page>
<PageHeader outlined={false}> <PageHeader outlined={false}>
+6 -4
View File
@@ -92,13 +92,15 @@ export function useTypingVerbs(userIds: string[]): Record<string, string | undef
let cancelled = false; let cancelled = false;
const unsubscribe = registerProfileCacheListener(() => setTick((tick) => tick + 1)); const unsubscribe = registerProfileCacheListener(() => setTick((tick) => tick + 1));
// setProfileCache does not notify listeners, so a fresh fetch has to re-render here
const rerender = () => {
if (!cancelled) setTick((tick) => tick + 1);
};
for (const userId of key.split(',')) { for (const userId of key.split(',')) {
if (getCachedProfileFields(userId)) continue; if (getCachedProfileFields(userId)) continue;
// setProfileCache does not notify listeners, so a fresh fetch has to re-render here
getProfileFields(mx, userId) getProfileFields(mx, userId)
.then(() => { .then(rerender)
if (!cancelled) setTick((tick) => tick + 1);
})
.catch(() => undefined); .catch(() => undefined);
} }
+2 -1
View File
@@ -215,10 +215,11 @@ export function extractMetadataFromImage(imageData: ArrayBuffer | Uint8Array): I
console.log('[extractMetadataFromImage] Detected format:', format); console.log('[extractMetadataFromImage] Detected format:', format);
switch (format) { switch (format) {
case 'png': case 'png': {
const pngMetadata = extractMetadataFromPNG(imageData); const pngMetadata = extractMetadataFromPNG(imageData);
console.log('[extractMetadataFromImage] PNG metadata:', pngMetadata); console.log('[extractMetadataFromImage] PNG metadata:', pngMetadata);
return pngMetadata; return pngMetadata;
}
// For other formats, extract color only for now // For other formats, extract color only for now
case 'webp': case 'webp':
case 'jpeg': case 'jpeg':