Skip to content

Commit

Permalink
Merge pull request #41636 from tienifr/fix/41062
Browse files Browse the repository at this point in the history
fix: deleted workspace room display in task share somewhere
  • Loading branch information
aldo-expensify authored May 14, 2024
2 parents 43e75ad + c7f128b commit 3e99a09
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions src/components/OptionListContextProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,22 +64,11 @@ function OptionsListContextProvider({reports, children}: OptionsListProviderProp
return;
}

const lastUpdatedReport = ReportUtils.getLastUpdatedReport();

if (!lastUpdatedReport) {
return;
}

const newOption = OptionsListUtils.createOptionFromReport(lastUpdatedReport, personalDetails);
const replaceIndex = options.reports.findIndex((option) => option.reportID === lastUpdatedReport.reportID);

if (replaceIndex === -1) {
return;
}
const newReports = OptionsListUtils.createOptionList({}, reports).reports;

setOptions((prevOptions) => {
const newOptions = {...prevOptions};
newOptions.reports[replaceIndex] = newOption;
newOptions.reports = newReports;
return newOptions;
});
// eslint-disable-next-line react-hooks/exhaustive-deps
Expand Down

0 comments on commit 3e99a09

Please sign in to comment.