MCPcopy Create free account
hub / github.com/Necriso/ScriptableWidgets / loadStation

Function loadStation

tankstellenpreisev2_beta.js:111–130  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

109}
110
111async function loadStation() {
112 let location
113
114let config = await loadConfig()
115
116 if (config.fixedLocation === 1) {
117 location = config.myLocation
118 } else {
119 location = await Location.current()
120 }
121 console.log(location)
122 const data = await new Request(apiURL(location, config.radius, config.apiKey)).loadJSON()
123
124 if (!data) {
125 const errorList = new ListWidget()
126 errorList.addText("Keine Ergebnisse für den aktuellen Ort gefunden.")
127 return errorList
128 }
129 return data
130}
131
132function formatValue(value) {
133 if (!value) {

Callers 1

Calls 2

loadConfigFunction · 0.85
apiURLFunction · 0.70

Tested by

no test coverage detected