fix: multiple bug fixes and improvements
- Fix suggested trips showing wrong sports for cross-country trips - Remove quick start sections from home variants (Classic, Spotify) - Remove dead quickActions code from HomeView - Fix pace capsule animation in TripCreationView - Add text wrapping to achievement descriptions - Improve poll parsing with better error handling - Various sharing system improvements Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -184,6 +184,13 @@ actor PollService {
|
||||
}
|
||||
|
||||
func deletePoll(_ pollId: UUID) async throws {
|
||||
// Verify ownership before deleting
|
||||
let poll = try await fetchPoll(byId: pollId)
|
||||
let userId = try await getCurrentUserRecordID()
|
||||
guard poll.ownerId == userId else {
|
||||
throw PollError.notPollOwner
|
||||
}
|
||||
|
||||
let recordID = CKRecord.ID(recordName: pollId.uuidString)
|
||||
|
||||
do {
|
||||
@@ -193,6 +200,8 @@ actor PollService {
|
||||
try await publicDatabase.deleteRecord(withID: recordID)
|
||||
} catch let error as CKError {
|
||||
throw mapCloudKitError(error)
|
||||
} catch let error as PollError {
|
||||
throw error
|
||||
} catch {
|
||||
throw PollError.unknown(error)
|
||||
}
|
||||
|
||||
@@ -484,13 +484,17 @@ final class SuggestedTripsGenerator {
|
||||
// Build richGames dictionary
|
||||
let richGames = buildRichGames(from: selectedGames, teams: teams, stadiums: stadiums)
|
||||
|
||||
// Compute sports from games actually in the trip (not all selectedGames)
|
||||
let gameIdsInTrip = Set(trip.stops.flatMap { $0.games })
|
||||
let actualSports = Set(gameIdsInTrip.compactMap { richGames[$0]?.game.sport })
|
||||
|
||||
return SuggestedTrip(
|
||||
id: UUID(),
|
||||
region: .crossCountry,
|
||||
isSingleSport: sports.count == 1,
|
||||
isSingleSport: actualSports.count == 1,
|
||||
trip: trip,
|
||||
richGames: richGames,
|
||||
sports: sports
|
||||
sports: actualSports.isEmpty ? sports : actualSports
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user