Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
siddheshraze committed Dec 6, 2024
1 parent 8fe6ad4 commit 4e3d9f9
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 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 @@ -43,11 +43,9 @@ const initialMeasurementsSummaryViewRDSRow: MeasurementsSummaryRDS = {
};

export default function MeasurementsSummaryViewDataGrid() {
const currentSite = useSiteContext();
const currentPlot = usePlotContext();
const currentCensus = useOrgCensusContext();
const currentSite = useSiteContext();
const { setLoading } = useLoading();
const [isUploadModalOpen, setIsUploadModalOpen] = useState(false);
const [isManualEntryFormOpen, setIsManualEntryFormOpen] = useState(false);
const [triggerGlobalError, setTriggerGlobalError] = useState(false);
Expand All @@ -67,13 +65,6 @@ export default function MeasurementsSummaryViewDataGrid() {
const [shouldAddRowAfterFetch, setShouldAddRowAfterFetch] = useState(false);
const { setLoading } = useLoading();

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 4e3d9f9

Please sign in to comment.