@data-fair/lib-vue 1.20.0 → 1.20.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.
Files changed (2) hide show
  1. package/async-action.js +9 -6
  2. package/package.json +1 -1
package/async-action.js CHANGED
@@ -26,14 +26,17 @@ export function useAsyncAction (fn, options) {
26
26
  if (options?.finally) { await options?.finally() }
27
27
  return result
28
28
  } catch (err) {
29
- error.value = getErrorMsg(err)
30
- const errorNotif = getFullNotif({ msg: options?.error ?? '', error: err })
31
- notif.value = errorNotif
32
- if (options?.catch !== 'error' && options?.catch !== 'all') {
33
- sendUiNotif(errorNotif)
29
+ const abortError = err.name === 'AbortError' || err.cause?.name === 'AbortError'
30
+ if (!abortError) {
31
+ error.value = getErrorMsg(err)
32
+ const errorNotif = getFullNotif({ msg: options?.error ?? '', error: err })
33
+ notif.value = errorNotif
34
+ if (options?.catch !== 'error' && options?.catch !== 'all') {
35
+ sendUiNotif(errorNotif)
36
+ }
34
37
  }
35
38
  loading.value = false
36
- if (options?.finally) { await options?.finally() }
39
+ if (options?.finally && !abortError) { await options?.finally() }
37
40
  }
38
41
  }
39
42
  return { execute, notif: shallowReadonly(notif), loading: readonly(loading), error: readonly(error) }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@data-fair/lib-vue",
3
- "version": "1.20.0",
3
+ "version": "1.20.1",
4
4
  "description": "Composables and other utilities for Vue applications in the data-fair stack.",
5
5
  "main": "index.js",
6
6
  "files": [