@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.
@@ -22954,13 +22954,23 @@ class SeamlyUnauthorizedError extends Error {
22954
22954
 
22955
22955
 
22956
22956
 
22957
-
22958
22957
  const handledErrorTypes = [SeamlyGeneralError, SeamlyConfigurationError, SeamlySessionExpiredError, SeamlyOfflineError, SeamlyUnauthorizedError];
22959
- function middleware_createMiddleware() {
22958
+ function middleware_createMiddleware({
22959
+ api
22960
+ }) {
22960
22961
  return () => next => action => {
22961
- if (action.type === String(set)) {
22962
- if (!some_default()(handledErrorTypes).call(handledErrorTypes, ErrorType => action.error instanceof ErrorType)) {
22963
- throw action.error;
22962
+ const {
22963
+ error
22964
+ } = action;
22965
+
22966
+ if (error) {
22967
+ if (!some_default()(handledErrorTypes).call(handledErrorTypes, ErrorType => error instanceof ErrorType)) {
22968
+ throw error;
22969
+ } else if (error.action === 'reset') {
22970
+ // [SMLY-942] We clear the store before a reset to force a new conversation if the page is refreshed before the conversation is reset
22971
+ api.disconnect().then(() => {
22972
+ api.clearStore();
22973
+ });
22964
22974
  }
22965
22975
  }
22966
22976
 
@@ -34350,7 +34360,9 @@ function store_createStore({
34350
34360
  initialState,
34351
34361
  middlewares: [es.withExtraArgument({
34352
34362
  api
34353
- }), createMiddleware(), middleware_createMiddleware(), options_middleware_createMiddleware({
34363
+ }), createMiddleware(), middleware_createMiddleware({
34364
+ api
34365
+ }), options_middleware_createMiddleware({
34354
34366
  api
34355
34367
  }), translations_middleware_createMiddleware()]
34356
34368
  });