Skip to content

Commit

Permalink
removing duplicate definition of async function from msvdatagrid
Browse files Browse the repository at this point in the history
  • Loading branch information
siddheshraze committed Dec 17, 2024
1 parent 1ff330d commit 2320293
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions frontend/components/datagrids/applications/msvdatagrid.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client';

import { useOrgCensusContext, usePlotContext, useSiteContext } from '@/app/contexts/userselectionprovider';
import React, { useState } from 'react';
import React, { useEffect, useState } from 'react';
import { GridRowModes, GridRowModesModel, GridRowsProp } from '@mui/x-data-grid';
import { randomId } from '@mui/x-data-grid-generator';
import { Snackbar } from '@mui/joy';
Expand Down Expand Up @@ -62,13 +62,6 @@ export default function MeasurementsSummaryViewDataGrid() {
const [isNewRowAdded, setIsNewRowAdded] = useState<boolean>(false);
const [shouldAddRowAfterFetch, setShouldAddRowAfterFetch] = useState(false);

async function reloadMSV() {
setLoading(true, 'Refreshing Measurements View...');
const response = await fetch(`/api/refreshviews/measurementssummary/${currentSite?.schemaName ?? ''}`, { method: 'POST' });
if (!response.ok) throw new Error('Measurements View Refresh failure');
await new Promise(resolve => setTimeout(resolve, 1000));
}

useEffect(() => {
reloadMSV()
.catch(console.error)
Expand Down

0 comments on commit 2320293

Please sign in to comment.