mirror of
https://github.com/fergalmoran/supanextail.git
synced 2025-12-22 09:17:54 +00:00
Fix ts errors with proper implementation
This commit is contained in:
@@ -35,8 +35,10 @@ const Avatar = ({ url, size, onUpload }: AvatarProps): JSX.Element => {
|
||||
}
|
||||
const url = URL.createObjectURL(data);
|
||||
setAvatarUrl(url);
|
||||
} catch (error) {
|
||||
console.log('Error downloading image: ');
|
||||
} catch (error: unknown) {
|
||||
if (error instanceof Error) {
|
||||
console.log('Error downloading image: ', error.message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,8 +69,10 @@ const Avatar = ({ url, size, onUpload }: AvatarProps): JSX.Element => {
|
||||
}
|
||||
|
||||
onUpload(filePath);
|
||||
} catch (error) {
|
||||
alert('There was an issue with the upload, please try again');
|
||||
} catch (error: unknown) {
|
||||
if (error instanceof Error) {
|
||||
alert(error.message);
|
||||
}
|
||||
} finally {
|
||||
setUploading(false);
|
||||
}
|
||||
|
||||
@@ -65,8 +65,10 @@ const Dashboard = ({ profile, session, plan }: DashboardProps): JSX.Element => {
|
||||
if (error) {
|
||||
throw error;
|
||||
}
|
||||
} catch (error) {
|
||||
alert('There was an issue with the update');
|
||||
} catch (error: unknown) {
|
||||
if (error instanceof Error) {
|
||||
alert(error.message);
|
||||
}
|
||||
} finally {
|
||||
setLoading(false);
|
||||
toast.success('Your profile has been updated');
|
||||
|
||||
Reference in New Issue
Block a user