@overmap-ai/core 1.0.61 → 1.0.62-store-clear-fixes.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/overmap-core.js
CHANGED
|
@@ -2335,10 +2335,17 @@ const _selectLatestFormRevision = (formRevisions, formId) => {
|
|
|
2335
2335
|
return ret;
|
|
2336
2336
|
};
|
|
2337
2337
|
const selectLatestFormRevisionOfForm = restructureCreateSelectorWithArgs(
|
|
2338
|
-
createSelector(
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2338
|
+
createSelector(
|
|
2339
|
+
[selectFormRevisionMapping, (_state, formId) => formId],
|
|
2340
|
+
(revisions, formId) => {
|
|
2341
|
+
const revisionsOfForm = Object.values(revisions).filter((revision) => revision.form === formId);
|
|
2342
|
+
if (revisionsOfForm.length === 0)
|
|
2343
|
+
return void 0;
|
|
2344
|
+
const sortedRevisions = revisionsOfForm.sort(formRevisionSortFn);
|
|
2345
|
+
const latestRevision = sortedRevisions[revisionsOfForm.length - 1];
|
|
2346
|
+
return revisions[latestRevision.offline_id];
|
|
2347
|
+
}
|
|
2348
|
+
)
|
|
2342
2349
|
);
|
|
2343
2350
|
const selectFormRevisionsOfForm = restructureCreateSelectorWithArgs(
|
|
2344
2351
|
createSelector(
|