l-min-components 1.7.1359 → 1.7.1360

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": "l-min-components",
3
- "version": "1.7.1359",
3
+ "version": "1.7.1360",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "src/assets",
@@ -65,6 +65,7 @@ const AppMainLayout = ({ children }) => {
65
65
  const [gracePeriod, setGracePeriod] = useState(true); // test
66
66
  const [deviceWidth, setDeviceWidth] = useState(window.innerWidth);
67
67
  const [showTest, setShowTest] = useState(null);
68
+ const [storageSummary, setStorageSummary] = useState(null);
68
69
  const [newLoadingForPostDefaultAccount, setNewLoadingForPostDefaultAccount] =
69
70
  useState(true);
70
71
  const [selectedAccount, setSelectedAccount] = useState();
@@ -316,12 +317,16 @@ const AppMainLayout = ({ children }) => {
316
317
 
317
318
  const [isAffiliateLoading, setIsAffiliateLoading] = useState(true);
318
319
 
319
- useEffect(() => {
320
- if (generalData?.selectedAccount?.type) {
321
- handleGetFileStorageSummary(
322
- generalData?.selectedAccount?.type?.toLowerCase()
323
- );
320
+ const handleGetStorageSummary = async () => {
321
+ const accountType = generalData?.selectedAccount?.type?.toLowerCase();
322
+ if (accountType) {
323
+ const res = await handleGetFileStorageSummary(accountType);
324
+ res?.data && setStorageSummary({ ...res?.data, results: undefined });
324
325
  }
326
+ };
327
+
328
+ useEffect(() => {
329
+ handleGetStorageSummary();
325
330
  }, [generalData?.selectedAccount]);
326
331
 
327
332
  return (
@@ -359,10 +364,8 @@ const AppMainLayout = ({ children }) => {
359
364
  notificationMarkReadData,
360
365
  handleGetNotificationMarkRead,
361
366
  planState,
362
- storageSummary: {
363
- ...getFileStorageSummaryData?.data,
364
- results: undefined,
365
- },
367
+ storageSummary,
368
+ refreshStorageSumary: handleGetStorageSummary,
366
369
  }}
367
370
  >
368
371
  {/* display mobile layout on device width*/}
@@ -505,6 +508,7 @@ const AppMainLayout = ({ children }) => {
505
508
  <DeveloperBanner findText={findText} />
506
509
  ))}
507
510
  {/* {rightComponent ?? <Banner />} */}
511
+ <button onClick={handleGetStorageSummary}>refresh</button>
508
512
  </RightLayout>
509
513
  )}
510
514
  </MainLayout>
@@ -388,7 +388,7 @@ const useHeader = (props = { default: false }) => {
388
388
  );
389
389
  const handleGetFileStorageSummary = async (accountType) => {
390
390
  try {
391
- await getFileStorageSummary({
391
+ return await getFileStorageSummary({
392
392
  url: `/media/v1/${accountType}/filemanager/overview/`,
393
393
  });
394
394
  } catch (error) {