adminforth 1.23.0 → 1.23.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -31,6 +31,13 @@ export async function callApi({path, method, body=undefined}: {
31
31
  }
32
32
  return await r.json();
33
33
  } catch(e) {
34
+ // if it is internal error, say to user
35
+ if (e instanceof TypeError && e.message === 'Failed to fetch') {
36
+ // this is a network error
37
+ adminforth.alert({variant:'danger', message: window.i18n?.global?.t('Network error, please check your Internet connection and try again'),})
38
+ return null;
39
+ }
40
+
34
41
  adminforth.alert({variant:'danger', message: window.i18n?.global?.t('Something went wrong, please try again later'),})
35
42
  console.error(`error in callApi ${path}`, e);
36
43
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adminforth",
3
- "version": "1.23.0",
3
+ "version": "1.23.1",
4
4
  "description": "OpenSource Vue3 powered forth-generation admin panel",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",