mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
fix(voice): Navara refusals reach speech, analyst queries and stop_tracking
Review of 10a (low): - The spoken answer to set_layer_visibility on a layer this engine lacks is the refusal's own sentence (why, and the switch to ?engine=cesium), not only "Couldn't turn on". - analyst_query naming layers the catalog left out (no viewer) refuses with UNAVAILABLE_ON_ENGINE and the layer ids instead of answering zero. - stop_tracking skips layers the engine does not have, so with nothing tracked it is a no-op success on Navara (it reported the absent military and satellites layers as failures). Tests for each (the old code fails the last two); Cesium unchanged.
This commit is contained in:
1 parent
443c581280
commit
1dd3220812
3 files changed
+86
-1
No files matched your search
@@ -103,6 +103,13 @@ function setLayerVisibility(result, args = {}) {
|
||||
if (result?.cancelled) return null;
|
||||
if (!result?.ok) {
|
||||
const wanted = args.enabled === false ? 'off' : 'on';
|
||||
// An engine without the layer says why and what to do (the refusal's
|
||||
// own sentence), not only that it failed.
|
||||
if (result?.code === 'UNAVAILABLE_ON_ENGINE' && result.error)
|
||||
return {
|
||||
say: result.error,
|
||||
display: { title: label, lines: [result.error] },
|
||||
};
|
||||
return {
|
||||
say: `Couldn't turn ${wanted} ${label}.`,
|
||||
display: { title: label, lines: [result?.error].filter(Boolean) },
|
||||
|
||||
Reference in new issue
Block a user