mirror of
https://github.com/usememos/memos.git
synced 2025-12-16 21:59:25 +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;
|
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,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue