From d7c35f5322a84c4c25847ef8b6e1c331485ba22d Mon Sep 17 00:00:00 2001 From: Simon Leech Date: Mon, 16 Oct 2023 15:14:53 +0100 Subject: [PATCH] Ensure tables response is always a string --- lib/location/get.mjs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/location/get.mjs b/lib/location/get.mjs index 48570ff7e..99cee2438 100644 --- a/lib/location/get.mjs +++ b/lib/location/get.mjs @@ -27,10 +27,10 @@ export default async function (location, list = location.layer.mapview.locations return; } + // Get dbs table from layer. - location.table = location.table - || location.layer.table - || Object.values(location.layer.tables).find(table => !!table) + location.table ??= location.layer.table || + Object.values(location.layer.tables).find(table => typeof table === 'string') // Get data from location api. const response = await mapp.utils.xhr( @@ -74,10 +74,10 @@ export default async function (location, list = location.layer.mapview.locations location.layer.mapview.interaction?.locations?.delete(location.hook) // A location must have a record from a listview. - location.record + location.record // Hooks must be enabled on the mapview. - && location.layer.mapview.hooks + && location.layer.mapview.hooks // Push location hook to URL params. && mapp.hooks.push('locations', location.hook)