Resolve the exhaustive-deps findings and attach cause to the rethrown errors. [skip build]
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}, []);
|
||||
|
||||
Reference in New Issue
Block a user