fix: Banner uploader fix error handling and reduce image size jump (#21903)
* improve uploader * better error handling * unnecessary check * more adjustments * remove logs
This commit is contained in:
1 parent
7075384313
commit
a5fe10189f
5 files changed
+35
-5
No files matched your search
@@ -183,6 +183,11 @@ const OrgProfileForm = ({ defaultValues }: { defaultValues: FormValues }) => {
|
||||
|
||||
const mutation = trpc.viewer.organizations.update.useMutation({
|
||||
onError: (err) => {
|
||||
// Handle JSON parsing errors from body size limit exceeded
|
||||
if (err.message.includes("Unexpected token") && err.message.includes("Body excee")) {
|
||||
showToast(t("converted_image_size_limit_exceed"), "error");
|
||||
return;
|
||||
}
|
||||
showToast(err.message, "error");
|
||||
},
|
||||
onSuccess: async (res) => {
|
||||
|
||||
Reference in new issue
Block a user