mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
chore: update error message (#129)
This commit is contained in:
@ -107,16 +107,16 @@ const MemoEditor: React.FC<Props> = () => {
|
|||||||
const { type } = file;
|
const { type } = file;
|
||||||
|
|
||||||
if (!type.startsWith("image")) {
|
if (!type.startsWith("image")) {
|
||||||
|
toastHelper.error("Only image file supported.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const image = await resourceService.upload(file);
|
const image = await resourceService.upload(file);
|
||||||
const url = `/h/r/${image.id}/${image.filename}`;
|
const url = `/h/r/${image.id}/${image.filename}`;
|
||||||
|
|
||||||
return url;
|
return url;
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
toastHelper.error(error);
|
toastHelper.error("Failed to upload image\n" + JSON.stringify(error, null, 4));
|
||||||
} finally {
|
} finally {
|
||||||
setState({
|
setState({
|
||||||
...state,
|
...state,
|
||||||
|
Reference in New Issue
Block a user