iOS/Sources/Extensions
Penait1 8159d3ff6c
Group by server, widget selection order (#3102)
## Summary
Fixed two issues mentioned in #3067;

Sensors in the suggested sensors view should be grouped by server now
The order of the selected sensors is now respected if they come from two
different servers

## Screenshots
![Screenshot 2024-10-27 at 08 06
20](https://github.com/user-attachments/assets/fe4ae23c-013d-49b1-a3dc-6fd12ae46bfb)

## Any other notes
The `for` loop bothers me, Swift feels a lot like Kotlin and a `map`
seems more appriopiate.
Because an async call happens in it I could not get `map` working that
is nice to read, let me know if there is a better option chatgpt gave me
this

```
let sensorValues = try await withThrowingTaskGroup(of: WidgetSensorsEntry.SensorData?.self) { group in
    for sensor in configuration.sensors ?? [] {
        group.addTask {
            guard let server = Current.servers.all.first(where: { $0.identifier.rawValue == sensor.serverId }) else {
                throw WidgetSensorsDataError.noServers
            }
            return try await fetchSensorData(for: sensor, server: server)
        }
    }

    return try await group.compactMap { $0 }
}
```
2024-10-28 09:49:49 +01:00
..
2021-11-27 12:33:46 -08:00
2024-10-25 16:09:24 +02:00