mirror of
https://github.com/usememos/memos.git
synced 2025-02-01 01:58:14 +08:00
chore: update error message (#129)
This commit is contained in:
parent
7e34de23f1
commit
38383a426f
1 changed files with 2 additions and 2 deletions
|
@ -107,16 +107,16 @@ const MemoEditor: React.FC<Props> = () => {
|
|||
const { type } = file;
|
||||
|
||||
if (!type.startsWith("image")) {
|
||||
toastHelper.error("Only image file supported.");
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
const image = await resourceService.upload(file);
|
||||
const url = `/h/r/${image.id}/${image.filename}`;
|
||||
|
||||
return url;
|
||||
} catch (error: any) {
|
||||
toastHelper.error(error);
|
||||
toastHelper.error("Failed to upload image\n" + JSON.stringify(error, null, 4));
|
||||
} finally {
|
||||
setState({
|
||||
...state,
|
||||
|
|
Loading…
Reference in a new issue