Skip to content

Commit

Permalink
fix: add guard statement to prevent deadlock from optional pack doubl…
Browse files Browse the repository at this point in the history
…efetch in `InstallGameView` + build bump
  • Loading branch information
vapidinfinity committed Nov 5, 2024
1 parent e6a56ce commit a375620
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Mythic.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,7 @@
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 3040;
CURRENT_PROJECT_VERSION = 3042;
DEAD_CODE_STRIPPING = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_ASSET_PATHS = "\"Mythic/Preview Content\"";
Expand Down Expand Up @@ -807,7 +807,7 @@
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 3040;
CURRENT_PROJECT_VERSION = 3042;
DEAD_CODE_STRIPPING = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_ASSET_PATHS = "\"Mythic/Preview Content\"";
Expand Down
5 changes: 3 additions & 2 deletions Mythic/Views/Unified/Sheets/InstallGameView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ struct InstallViewEvo: View {

@State var optionalPacks: [String: String] = .init()
@State var selectedOptionalPacks: Set<String> = .init()
@State var fetchingOptionalPacks: Bool = true
@State var fetchingOptionalPacks: Bool = false

@State var installSize: Double?

Expand All @@ -28,6 +28,7 @@ struct InstallViewEvo: View {
@ObservedObject var operation: GameOperation = .shared

private func fetchOptionalPacks() async {
guard !fetchingOptionalPacks else { return }
withAnimation { fetchingOptionalPacks = true }

try? await Legendary.command(
Expand Down Expand Up @@ -189,7 +190,7 @@ struct InstallViewEvo: View {
}

if let platforms = supportedPlatforms {
platform = platforms.contains(.macOS) ? .macOS : .windows
platform = platforms.contains(.macOS) ? .macOS : (supportedPlatforms?.first ?? .windows)
}

if let supportedPlatforms = supportedPlatforms,
Expand Down

0 comments on commit a375620

Please sign in to comment.