Fix the mechanical style rules. [skip build]

This commit is contained in:
2026-11-01 09:01:32 +11:00
parent 831ce01150
commit 9591d8d01b
42 changed files with 762 additions and 756 deletions
+1 -1
View File
@@ -177,7 +177,7 @@ export function Settings({ initialPage, requestClose }: SettingsProps) {
// Fallback scroll if the page just mounted and tiles need a moment to render.
useEffect(() => {
if (!focusAnchorId) return;
if (!focusAnchorId) return undefined;
let cancelled = false;
let attempts = 0;
@@ -388,11 +388,11 @@ export function CollectiblesSection({ collectibles, onApply }: CollectiblesSecti
useEffect(() => {
setSelectedByGroup((prev) => {
const next = { ...prev };
for (const group of filteredGroups) {
filteredGroups.forEach((group) => {
if (!next[group.id] || !group.items.some((item) => item.skuId === next[group.id])) {
next[group.id] = group.items[0]?.skuId ?? '';
}
}
});
return next;
});
}, [filteredGroups]);
@@ -88,10 +88,10 @@ function ProfileBanner({
const decoration = collectibles.avatar_decoration;
if (!decoration) return undefined;
const assetUrls: Record<string, string | undefined> = {};
for (const [role, mxc] of Object.entries(decoration.assets)) {
Object.entries(decoration.assets).forEach(([role, mxc]) => {
assetUrls[`avatar_decoration:${role}`] =
mxcUrlToHttp(mx, mxc, useAuthentication) ?? undefined;
}
});
return pickAvatarDecorationUrl(assetUrls);
}, [collectibles.avatar_decoration, mx, useAuthentication]);
@@ -30,9 +30,9 @@ export function getStoreVersion(): number {
*/
export function dispatchPluginButtonsChanged(): void {
storeVersion += 1;
for (const listener of listeners) {
listeners.forEach((listener) => {
listener();
}
});
}
interface PluginButtonSlotProps {
@@ -49,51 +49,47 @@ export function PluginLoader({ matrixClient, children }: PluginLoaderProps) {
console.error(
`[PluginLoader] Plugin ${installedPlugin.id} does not export a valid plugin object`,
);
continue;
}
if (typeof plugin.onLoad !== 'function') {
} else if (typeof plugin.onLoad !== 'function') {
console.error(
`[PluginLoader] Plugin ${installedPlugin.id} does not have an onLoad function`,
);
continue;
}
const context = createPluginContext(
{
pluginId: installedPlugin.id,
eventClient: matrixClient as any,
onNotify: async (opts) => {
await sendNotification({
title: opts.title,
body: opts.body,
path: undefined,
});
} else {
const context = createPluginContext(
{
pluginId: installedPlugin.id,
eventClient: matrixClient as any,
onNotify: async (opts) => {
await sendNotification({
title: opts.title,
body: opts.body,
path: undefined,
});
},
},
},
pluginRegistry,
);
pluginRegistry,
);
const compatContext = Object.assign(context as Record<string, unknown>, {
matrixClient,
matrix: {
on: (eventType: string, handler: (...args: unknown[]) => void) =>
matrixClient.on(eventType as any, handler as any),
off: (eventType: string, handler: (...args: unknown[]) => void) =>
matrixClient.off(eventType as any, handler as any),
},
React,
lucide,
});
const compatContext = Object.assign(context as Record<string, unknown>, {
matrixClient,
matrix: {
on: (eventType: string, handler: (...args: unknown[]) => void) =>
matrixClient.on(eventType as any, handler as any),
off: (eventType: string, handler: (...args: unknown[]) => void) =>
matrixClient.off(eventType as any, handler as any),
},
React,
lucide,
});
console.log('[PluginLoader] compatContext.React:', !!compatContext.React);
console.log('[PluginLoader] compatContext.ui:', !!compatContext.ui);
console.log('[PluginLoader] About to register plugin and call onLoad...');
console.log('[PluginLoader] compatContext.React:', !!compatContext.React);
console.log('[PluginLoader] compatContext.ui:', !!compatContext.ui);
console.log('[PluginLoader] About to register plugin and call onLoad...');
pluginRegistry.registerPlugin(installedPlugin.id, plugin, context);
await plugin.onLoad(compatContext as any);
console.log(`[PluginLoader] Successfully loaded plugin: ${installedPlugin.id}`);
dispatchPluginButtonsChanged();
pluginRegistry.registerPlugin(installedPlugin.id, plugin, context);
await plugin.onLoad(compatContext as any);
console.log(`[PluginLoader] Successfully loaded plugin: ${installedPlugin.id}`);
dispatchPluginButtonsChanged();
}
} catch (error) {
console.error(`[PluginLoader] Failed to load plugin ${installedPlugin.id}:`, error);
pluginRegistry.addLog(installedPlugin.id, 'error', ['Failed to load:', error]);