@seamly/web-ui 19.0.0-beta.3 → 19.0.0
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/build/dist/lib/index.debug.js +2 -2
- package/build/dist/lib/index.debug.min.js +1 -1
- package/build/dist/lib/index.js +18 -6
- package/build/dist/lib/index.min.js +1 -1
- package/build/dist/lib/standalone.js +18 -6
- package/build/dist/lib/standalone.min.js +1 -1
- package/build/dist/lib/style-guide.js +15 -5
- package/package.json +1 -1
- package/src/javascripts/domains/interrupt/middleware.js +10 -9
- package/src/javascripts/domains/store/index.js +1 -1
|
@@ -3485,13 +3485,23 @@ class SeamlyUnauthorizedError extends Error {
|
|
|
3485
3485
|
|
|
3486
3486
|
|
|
3487
3487
|
|
|
3488
|
-
|
|
3489
3488
|
const handledErrorTypes = [SeamlyGeneralError, SeamlyConfigurationError, SeamlySessionExpiredError, SeamlyOfflineError, SeamlyUnauthorizedError];
|
|
3490
|
-
function middleware_createMiddleware(
|
|
3489
|
+
function middleware_createMiddleware({
|
|
3490
|
+
api
|
|
3491
|
+
}) {
|
|
3491
3492
|
return () => next => action => {
|
|
3492
|
-
|
|
3493
|
-
|
|
3494
|
-
|
|
3493
|
+
const {
|
|
3494
|
+
error
|
|
3495
|
+
} = action;
|
|
3496
|
+
|
|
3497
|
+
if (error) {
|
|
3498
|
+
if (!handledErrorTypes.some(ErrorType => error instanceof ErrorType)) {
|
|
3499
|
+
throw error;
|
|
3500
|
+
} else if (error.action === 'reset') {
|
|
3501
|
+
// [SMLY-942] We clear the store before a reset to force a new conversation if the page is refreshed before the conversation is reset
|
|
3502
|
+
api.disconnect().then(() => {
|
|
3503
|
+
api.clearStore();
|
|
3504
|
+
});
|
|
3495
3505
|
}
|
|
3496
3506
|
}
|
|
3497
3507
|
|
package/package.json
CHANGED
|
@@ -3,7 +3,6 @@ import SeamlyConfigurationError from '../../api/errors/seamly-configuration-erro
|
|
|
3
3
|
import SeamlySessionExpiredError from '../../api/errors/seamly-session-expired-error'
|
|
4
4
|
import SeamlyOfflineError from '../../api/errors/seamly-offline-error'
|
|
5
5
|
import SeamlyUnauthorizedError from '../../api/errors/seamly-unauthorized-error'
|
|
6
|
-
import * as Actions from './actions'
|
|
7
6
|
|
|
8
7
|
const handledErrorTypes = [
|
|
9
8
|
SeamlyGeneralError,
|
|
@@ -13,15 +12,17 @@ const handledErrorTypes = [
|
|
|
13
12
|
SeamlyUnauthorizedError,
|
|
14
13
|
]
|
|
15
14
|
|
|
16
|
-
export default function createMiddleware() {
|
|
15
|
+
export default function createMiddleware({ api }) {
|
|
17
16
|
return () => (next) => (action) => {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
17
|
+
const { error } = action
|
|
18
|
+
if (error) {
|
|
19
|
+
if (!handledErrorTypes.some((ErrorType) => error instanceof ErrorType)) {
|
|
20
|
+
throw error
|
|
21
|
+
} else if (error.action === 'reset') {
|
|
22
|
+
// [SMLY-942] We clear the store before a reset to force a new conversation if the page is refreshed before the conversation is reset
|
|
23
|
+
api.disconnect().then(() => {
|
|
24
|
+
api.clearStore()
|
|
25
|
+
})
|
|
25
26
|
}
|
|
26
27
|
}
|
|
27
28
|
|