Skip to content

Commit

Permalink
- reverting to old code so that sites not in project activity list ca…
Browse files Browse the repository at this point in the history
…n be displayed.
  • Loading branch information
temi committed Dec 3, 2024
1 parent 75e3b64 commit 74938e3
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion grails-app/assets/javascripts/viewModels.js
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,20 @@ function enmapify(args) {
})[0];
//search from site collection in case it is a private site
if (!matchingSite) {
offlineGetSiteAndAddToSiteList(siteId)
fetchSite(siteId).done(function (result) {
if (result.data) {
var site = result.data;
site.name='Location of the sighting';
sitesObservable.push(site);
matchingSite = site;
map.clearBoundLimits();
map.setGeoJSON(Biocollect.MapUtilities.featureToValidGeoJson(matchingSite.extent.geometry));
// Reassign since siteIdObservable value is cleared when the site is not listed in sitesObservable.
siteIdObservable(siteId);
}
}).fail(function(result) {
console.log(result.message);
});
}

// TODO: OPTIMISE THE PROCEDUE
Expand Down

0 comments on commit 74938e3

Please sign in to comment.