Skip to content

Commit

Permalink
fix(ios): app icon refreshes in settings
Browse files Browse the repository at this point in the history
  • Loading branch information
autoreleasefool committed Oct 5, 2024
1 parent 44654f8 commit f41067f
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions ios/Approach/Sources/SettingsFeature/Settings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,7 @@ public struct Settings: Reducer, Sendable {
return .none

case .didFirstAppear:
return .run { send in
await send(.internal(.didFetchIcon(Result {
AppIcon(rawValue: await appIcon.getAppIconName() ?? "")
})))
}
return refreshAppIcon()

case .didTapPopulateDatabase:
return .run { _ in try await databaseMocking.mockDatabase() }
Expand Down Expand Up @@ -242,7 +238,9 @@ public struct Settings: Reducer, Sendable {
switch state.destination {
case .export:
return .run { _ in export.cleanUp() }
case .analytics, .appIcon, .archive, .featureFlags, .opponentsList, .statistics, .alert, .none, .import:
case .appIcon:
return refreshAppIcon()
case .analytics, .archive, .featureFlags, .opponentsList, .statistics, .alert, .none, .import:
return .none
}

Expand Down Expand Up @@ -310,4 +308,12 @@ public struct Settings: Reducer, Sendable {
}
}
}

private func refreshAppIcon() -> Effect<Action> {
return .run { send in
await send(.internal(.didFetchIcon(Result {
AppIcon(rawValue: await appIcon.getAppIconName() ?? "")
})))
}
}
}

0 comments on commit f41067f

Please sign in to comment.