Skip to content

Commit

Permalink
reduce if to use optional chain
Browse files Browse the repository at this point in the history
  • Loading branch information
LocalNewsTV committed Nov 27, 2024
1 parent ed4ad23 commit 8fe0765
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions app/src/utils/filterRecordsetsByNetworkState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@ import { UserRecordCacheStatus, UserRecordSet } from 'interfaces/UserRecordSet';
* @param userOffline Current Network state of user,
* @returns Users accessible recordsets
*/
const filterRecordsetsByNetworkState = (recordSets: Record<string, UserRecordSet>, userOffline: boolean): string[] => {
return Object.keys(recordSets).filter((set) => {
const filterRecordsetsByNetworkState = (recordSets: Record<string, UserRecordSet>, userOffline: boolean): string[] =>
Object.keys(recordSets).filter((set) => {
return recordSets[set].cacheMetadata.status === UserRecordCacheStatus.CACHED || !userOffline;
});
};

export default filterRecordsetsByNetworkState;

0 comments on commit 8fe0765

Please sign in to comment.