Skip to content

Conversation

Camji55
Copy link
Member

@Camji55 Camji55 commented Aug 21, 2025

@Camji55 Camji55 requested a review from ps2 August 21, 2025 18:53
Comment on lines -118 to +126
let container = try decoder.container(keyedBy: CodingKeys.self)
if let symbolTypeValue = try container.decodeIfPresent(SymbolType.self, forKey: .symbolType) {
self.symbolType = symbolTypeValue
if let container = try? decoder.container(keyedBy: CodingKeys.self) {
self.symbolType = try container.decode(SymbolType.self, forKey: .symbolType)
self.tint = try container.decodeIfPresent(SymbolTint.self, forKey: .tint)
self.value = try container.decode(String.self, forKey: .value)
} else {
let container = try decoder.singleValueContainer()
self.symbolType = .emoji
self.tint = nil
self.value = try container.decode(String.self, forKey: .symbolType)
self.value = try container.decode(String.self)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is to support migration from the old preset symbol type to the new one.

Comment on lines +365 to +366
case "legacyWorkout":
self = .custom
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If a legacy workout is found when trying to decode, I just have it marked as custom here. I think ideally, this would decode into a .preset(TemporaryPreset), but I'm not sure what settings I'd provide it.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is ok as is.

Copy link

@ps2 ps2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Comment on lines +365 to +366
case "legacyWorkout":
self = .custom
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is ok as is.

@Camji55 Camji55 merged commit 45e9fcc into dev Aug 22, 2025
1 check passed
@Camji55 Camji55 deleted the cameron/LOOP-5405-activity-presets-core branch August 22, 2025 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants