Skip to content
Snippets Groups Projects

Main

Merged Piotr Gawron requested to merge main into development
1 file
+ 13
3
Compare changes
  • Side-by-side
  • Inline
import { OverlayBioEntityRender } from '@/types/OLrendering';
import { createSelector } from '@reduxjs/toolkit';
import { allSubmapConnectionsBioEntitySelector } from '@/redux/bioEntity/bioEntity.selectors';
import { mapModelIdSelector } from '@/redux/map/map.selectors';
import { currentSearchedBioEntityId } from '../drawer/drawer.selectors';
import { currentModelIdSelector } from '../models/models.selectors';
import {
@@ -86,9 +87,18 @@ export const isOverlayActiveSelector = createSelector(
);
export const isOverlayLoadingSelector = createSelector(
[overlayBioEntitySelector, (_, overlayId: number): number => overlayId],
({ overlaysId, data }, overlayId) =>
overlaysId.includes(overlayId) && data[overlayId] && !Object.keys(data[overlayId]).length,
[overlayBioEntitySelector, mapModelIdSelector, (_, overlayId: number): number => overlayId],
({ overlaysId, data }, mapId, overlayId) => {
let result = false;
if (overlaysId.includes(overlayId)) {
if (data[overlayId] && !Object.keys(data[overlayId]).length) {
result = true;
} else if (data[overlayId] && !data[overlayId][mapId]) {
result = true;
}
}
return result;
},
);
export const activeOverlaysSelector = createSelector(
Loading