Fix the mechanical lint groups and delete the unused bindings. [skip build]
This commit is contained in:
@@ -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" />
|
||||
|
||||
@@ -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) => [
|
||||
|
||||
Reference in New Issue
Block a user