Skip to content

Commit

Permalink
feat: modified conditional
Browse files Browse the repository at this point in the history
  • Loading branch information
lc-hd committed Oct 9, 2024
1 parent 65a5c9b commit 5f0d274
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@
const boundaryData = await boundaryResponse.json()
hideSpinner()

if (boundaryData.coordinates.length === 0 && boundaryData.coordinates[0].length) {
if (!boundaryData.coordinates[0].length) {
const errorMessage = 'Selected location does not have any Native Land boundary'
raiseError(selectionUnit, errorMessage)
throw new Error(errorMessage)
Expand Down
2 changes: 1 addition & 1 deletion templates/communities/add-community-boundary.html
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ <h2 class="mt-0">Search the Native Land Digital database</h2>
document.querySelector("#community-boundary-continue-btn .fa-spinner").classList.remove("spinner-container");
document.getElementById("community-boundary-continue-btn").classList.remove("disabled-btn");

if (boundaryData.coordinates.length === 0 && boundaryData.coordinates[0].length) {
if (!boundaryData.coordinates[0].length) {
const errorMessage = 'Selected location does not have any Native Land boundary'
alert(errorMessage)
throw new Error(errorMessage)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@
const boundaryData = await boundaryResponse.json()
hideSpinner()

if (boundaryData.coordinates.length === 0 && boundaryData.coordinates[0].length) {
if (!boundaryData.coordinates[0].length) {
const errorMessage = 'Selected location does not have any Native Land boundary'
raiseError(selectionUnit, errorMessage)
throw new Error(errorMessage)
Expand Down

0 comments on commit 5f0d274

Please sign in to comment.