@sonic-equipment/ui 249.0.0 → 250.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.
@@ -1,6 +1,7 @@
1
1
  "use client";
2
2
  import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
3
3
  import { useMemo, useEffect } from 'react';
4
+ import Cookies from 'js-cookie';
4
5
  import { logger } from '../logging/logger.js';
5
6
  import { useCookiebot } from '../shared/hooks/use-cookiebot.js';
6
7
  import { useDisclosure } from '../shared/hooks/use-disclosure.js';
@@ -43,6 +44,10 @@ function ConnectedCountrySelector({ defaultCountryCode, defaultLanguageCode, onC
43
44
  return;
44
45
  setIsOpen(open);
45
46
  }, onSubmit: async ({ country, language }) => {
47
+ // set selected country and language IDs client side as a fallback; server response may overwrite values
48
+ const expires = 365; // 1 year
49
+ Cookies.set('CurrentCountryId', country.id, { expires });
50
+ Cookies.set('CurrentLanguageId', language.id, { expires });
46
51
  if (selectedCountry?.id === country.id &&
47
52
  selectedLanguage?.id === language.id)
48
53
  return close();
@@ -13,6 +13,11 @@ function useSignOut(options = {}) {
13
13
  onSuccess: (_data, variables) => {
14
14
  // TODO: Remove when Spire is deprecated
15
15
  Cookies.remove('NavigationMode');
16
+ // Removing certain cookies in case the session doesn't do this
17
+ // This is, however, following user action; in case the server cancels authentication, this does not get run
18
+ Cookies.remove('CurrentBillToId');
19
+ Cookies.remove('CurrentShipToId');
20
+ Cookies.remove('BillToIdShipToId');
16
21
  navigate((variables && variables.returnUrl) || paths.HOME, {
17
22
  reload: true,
18
23
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sonic-equipment/ui",
3
- "version": "249.0.0",
3
+ "version": "250.0.0",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "engines": {