Apply the auto-fixable lint rules and the formatter, and drop the Vite build artifacts.
This commit is contained in:
@@ -66,7 +66,7 @@ export type InaccessibleScanResult = {
|
||||
*/
|
||||
export async function collectInaccessibleSpaceChildren(
|
||||
mx: MatrixClient,
|
||||
rootSpaceId: string
|
||||
rootSpaceId: string,
|
||||
): Promise<InaccessibleScanResult> {
|
||||
let hierarchySummaries = new Map<string, { room_id: string }>();
|
||||
try {
|
||||
@@ -125,7 +125,7 @@ export async function collectInaccessibleSpaceChildren(
|
||||
async function removeSpaceChildrenSequentially(
|
||||
mx: MatrixClient,
|
||||
children: InaccessibleSpaceChild[],
|
||||
onProgress?: (current: number, total: number) => void
|
||||
onProgress?: (current: number, total: number) => void,
|
||||
): Promise<void> {
|
||||
const total = children.length;
|
||||
|
||||
@@ -160,7 +160,7 @@ export function RemoveInaccessiblePrompt({
|
||||
const [scanResult, setScanResult] = useState<InaccessibleScanResult | null>(null);
|
||||
|
||||
const [scanState, scan] = useAsyncCallback<InaccessibleScanResult, MatrixError | Error, []>(
|
||||
useCallback(async () => collectInaccessibleSpaceChildren(mx, roomId), [mx, roomId])
|
||||
useCallback(async () => collectInaccessibleSpaceChildren(mx, roomId), [mx, roomId]),
|
||||
);
|
||||
|
||||
const children = scanResult?.inaccessible ?? null;
|
||||
@@ -172,7 +172,7 @@ export function RemoveInaccessiblePrompt({
|
||||
setProgress({ current, total });
|
||||
});
|
||||
setProgress(null);
|
||||
}, [mx, children])
|
||||
}, [mx, children]),
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
@@ -191,8 +191,12 @@ export function RemoveInaccessiblePrompt({
|
||||
}
|
||||
}, [removeState, onDone]);
|
||||
|
||||
const previewIds = useMemo(() => (children ?? []).slice(0, PREVIEW_LIMIT).map((c) => c.roomId), [children]);
|
||||
const isScanning = scanState.status === AsyncStatus.Loading || scanState.status === AsyncStatus.Idle;
|
||||
const previewIds = useMemo(
|
||||
() => (children ?? []).slice(0, PREVIEW_LIMIT).map((c) => c.roomId),
|
||||
[children],
|
||||
);
|
||||
const isScanning =
|
||||
scanState.status === AsyncStatus.Loading || scanState.status === AsyncStatus.Idle;
|
||||
const isRemoving = removeState.status === AsyncStatus.Loading;
|
||||
const count = children?.length ?? 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user