@bjsdistribution/dms-client-return 0.0.22 → 0.0.23

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,5 +1,5 @@
1
1
  {
2
- "version": "0.0.22",
2
+ "version": "0.0.23",
3
3
  "license": "MIT",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
@@ -211,12 +211,6 @@ function SelectionFilter() {
211
211
  }
212
212
  };
213
213
 
214
- useEffect(() => {
215
- return () => {
216
- dispatch({ type: 'CLEAR_CLIENT' });
217
- };
218
- }, []);
219
-
220
214
  useEffect(() => {
221
215
  if (storedClientId) {
222
216
  dispatch({
@@ -249,6 +243,8 @@ function SelectionFilter() {
249
243
  }
250
244
  }, [selectedFilterValue, selectedLocationValue]);
251
245
 
246
+ console.log(storedName, 'storedName');
247
+
252
248
  return (
253
249
  <Wrapper>
254
250
  <FilterRow>
@@ -264,7 +260,7 @@ function SelectionFilter() {
264
260
  />
265
261
  </FilterColumn>
266
262
 
267
- {storedName && location.pathname.includes(`/filter/`) ? (
263
+ {storedName && location.pathname.includes(`filter/`) ? (
268
264
  <>
269
265
  <FilterColumn>
270
266
  <Label>Action Type</Label>
package/src/index.tsx CHANGED
@@ -40,8 +40,19 @@ function ReturnClient() {
40
40
  console.log(selectedClientString, 'selectedClient');
41
41
  console.log(`../filter/:${selectedClientString}`);
42
42
 
43
+ const splitPath = (str: any) => {
44
+ const parts = str?.split('/')?.filter((part: any) => part !== ''); // Filter out empty parts
45
+ return parts;
46
+ };
47
+ const paths = splitPath(location.pathname);
48
+ console.log(paths, 'pathssssssssssssssssssssssssssss');
49
+
43
50
  useEffect(() => {
44
- if (location.pathname.includes('/returnclient')) {
51
+ console.log(
52
+ paths[paths.length - 1],
53
+ 'paths[paths.length] paths[paths.length]'
54
+ );
55
+ if (paths[paths.length - 1] === 'returnclient') {
45
56
  localStorage.removeItem('clientName');
46
57
  localStorage.removeItem('clientId');
47
58
  localStorage.removeItem('uuid');