Resolve the exhaustive-deps findings and attach cause to the rethrown errors. [skip build]
Checks / checks (push) Successful in 2m7s
Trigger cinny-mobile / dispatch (push) Successful in 2s

This commit is contained in:
2026-11-01 23:04:36 +11:00
parent 027dbee1f1
commit 634d1e0a0f
12 changed files with 31 additions and 49 deletions
+1 -1
View File
@@ -76,7 +76,7 @@ export const useAsync = <TData, TError, TArgs extends unknown[]>(
return data;
} catch (e) {
if (currentReqNumber !== reqNumberRef.current) {
throw new Error('AsyncCallbackHook: Request replaced!');
throw new Error('AsyncCallbackHook: Request replaced!', { cause: e });
}
if (alive()) {
+9 -15
View File
@@ -62,18 +62,12 @@ export const useAuthenticatedMediaUrl = (
* Creates an authenticated fetch function for media URLs.
* Useful for components that need to load multiple images.
*/
export const useAuthenticatedMediaFetch = () => {
const mx = useMatrixClient();
return useCallback(
async (src: string, useAuthentication = true): Promise<string> => {
try {
return await resolveAuthenticatedMediaUrl(src, useAuthentication);
} catch (error) {
console.warn('[useAuthenticatedMediaFetch] Error fetching authenticated media:', error);
return src;
}
},
[mx],
);
};
export const useAuthenticatedMediaFetch = () =>
useCallback(async (src: string, useAuthentication = true): Promise<string> => {
try {
return await resolveAuthenticatedMediaUrl(src, useAuthentication);
} catch (error) {
console.warn('[useAuthenticatedMediaFetch] Error fetching authenticated media:', error);
return src;
}
}, []);
+1 -1
View File
@@ -61,7 +61,7 @@ export const useMemberPowerSort = (
return getPowerLevel(b.userId) - getPowerLevel(a.userId);
},
[creators],
[creators, getPowerLevel],
);
return sort;
+6 -9
View File
@@ -281,15 +281,12 @@ export const useHomeHidden = (): [boolean, Dispatch<SetStateAction<boolean>>] =>
useAccountDataCallback(
mx,
useCallback(
(mEvent) => {
if (mEvent.getType() === AccountDataEvent.CinnySpaces) {
const newContent = mEvent.getContent<InCinnySpacesContent>();
setHomeHidden(newContent?.hideHome ?? false);
}
},
[mx],
),
useCallback((mEvent) => {
if (mEvent.getType() === AccountDataEvent.CinnySpaces) {
const newContent = mEvent.getContent<InCinnySpacesContent>();
setHomeHidden(newContent?.hideHome ?? false);
}
}, []),
);
return [homeHidden, setHomeHidden];