(configuration)
| 58 | |
| 59 | |
| 60 | async function createAlert(configuration) { |
| 61 | console.log('Creating alert with data') |
| 62 | |
| 63 | const alert = new Alert() |
| 64 | alert.title = `Settings` |
| 65 | |
| 66 | if (!configuration.fixedLocation) { |
| 67 | configuration.fixedLocation = "0" |
| 68 | } |
| 69 | |
| 70 | if (!configuration.myLocation.latitude) { |
| 71 | configuration.myLocation.latitude = '' |
| 72 | } |
| 73 | |
| 74 | if (!configuration.myLocation.longitude) { |
| 75 | configuration.myLocation.longitude = '' |
| 76 | } |
| 77 | |
| 78 | alert.addTextField('API-Key', configuration.apiKey || '') |
| 79 | alert.addTextField('Radius in km (e.g 1)', configuration.radius.toString()) |
| 80 | alert.addTextField('Fixed Location (0 or 1)', configuration.fixedLocation.toString()) |
| 81 | alert.addTextField('Fixed Latitude (e.g. 53.511)', configuration.myLocation.latitude.toString()) |
| 82 | alert.addTextField('Fixed Longitude (e.g. 9.9937)', configuration.myLocation.longitude.toString()) |
| 83 | alert.addAction('Cancel'); // 0 |
| 84 | alert.addAction('Submit'); // 1 |
| 85 | |
| 86 | return alert; |
| 87 | } |
| 88 | |
| 89 | async function storeConfig(data) |
| 90 | { |
no outgoing calls
no test coverage detected