@seamly/web-ui 21.0.7 → 21.0.8

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seamly/web-ui",
3
- "version": "21.0.7",
3
+ "version": "21.0.8",
4
4
  "main": "build/dist/lib/index.js",
5
5
  "types": "build/src/javascripts/index.d.ts",
6
6
  "module": "",
@@ -1,27 +1,20 @@
1
- import SeamlyConfigurationError from 'api/errors/seamly-configuration-error'
2
1
  import SeamlyGeneralError from 'api/errors/seamly-general-error'
3
- import SeamlyOfflineError from 'api/errors/seamly-offline-error'
4
- import SeamlySessionExpiredError from 'api/errors/seamly-session-expired-error'
5
- import SeamlyUnauthorizedError from 'api/errors/seamly-unauthorized-error'
6
- import SeamlyUnavailableError from 'api/errors/seamly-unavailable-error'
7
2
  import { setInterrupt } from 'domains/interrupt/slice'
8
3
 
9
4
  const handledErrorTypes = [
10
- SeamlyGeneralError,
11
- SeamlyConfigurationError,
12
- SeamlySessionExpiredError,
13
- SeamlyOfflineError,
14
- SeamlyUnauthorizedError,
15
- SeamlyUnavailableError,
5
+ 'SeamlyGeneralError',
6
+ 'SeamlyConfigurationError',
7
+ 'SeamlySessionExpiredError',
8
+ 'SeamlyOfflineError',
9
+ 'SeamlyUnauthorizedError',
10
+ 'SeamlyUnavailableError',
16
11
  ]
17
12
 
18
13
  export default function createInterruptMiddleware({ api }) {
19
14
  return () => (next) => (action) => {
20
15
  const { payload, type } = action
21
16
  if (type === setInterrupt.type) {
22
- if (
23
- !handledErrorTypes.some((ErrorType) => payload.name === ErrorType.name)
24
- ) {
17
+ if (!handledErrorTypes.includes(payload.name)) {
25
18
  throw new SeamlyGeneralError(payload)
26
19
  } else if (payload.action === 'reset') {
27
20
  // [SMLY-942] We clear the store before a reset to force a new conversation if the page is refreshed before the conversation is reset