Skip to content

Commit

Permalink
Remove points selectors after decoding
Browse files Browse the repository at this point in the history
  • Loading branch information
Rub21 committed Nov 13, 2023
1 parent d4edc5c commit b46cad0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions src/components/Decode.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,18 @@ export const Decode = () => {
activeClass
);
const olFeatures = features2olFeatures(features);
// Add items
dispatchSetItems({
type: "SET_ITEMS",
payload: [...items, ...olFeatures],
});

// Set empty the point selectors
dispatchSetPointsSelector({
type: "SET_EMPTY_POINT",
payload: [],
});

// save in iddexedDB
features.forEach((feature) => {
storeItems.addData(feature);
Expand Down Expand Up @@ -122,10 +129,6 @@ export const Decode = () => {
multiDecoderType
);
await decodePrompt(reqProps);
dispatchSetPointsSelector({
type: "SET_EMPTY_POINT",
payload: [],
});
};

const setDecodeType = (decodeType) => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/map/ProjectLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export const ProjectLayer = ({ project, items, highlightedItem }) => {
// Display points selector in the map
useEffect(() => {
if (!map) return;
if (pointsSelector.length === 0) return;
// if (pointsSelector.length === 0) return;

const pointsSelectorDataSource = new VectorSource({
features: pointsSelector,
Expand Down

0 comments on commit b46cad0

Please sign in to comment.