mirror of
https://github.com/pawelorzech/MacTorn.git
synced 2026-01-30 04:04:27 +00:00
fix: Resolve SwiftUI constraint update loop in MenuBarExtra
- Add .transaction { $0.animation = nil } to prevent constraint recalculation loops
- Add CreditsView.swift to Xcode project (was missing after git pull)
- Fixes NSGenericException for Update Constraints in Window passes
This commit is contained in:
parent
71db6d4db1
commit
0764a38bb8
4 changed files with 18 additions and 9 deletions
|
|
@ -29,6 +29,7 @@
|
||||||
AAA00020 /* PropertiesView.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAA10021 /* PropertiesView.swift */; };
|
AAA00020 /* PropertiesView.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAA10021 /* PropertiesView.swift */; };
|
||||||
AAA00021 /* NetworkSession.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAA10022 /* NetworkSession.swift */; };
|
AAA00021 /* NetworkSession.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAA10022 /* NetworkSession.swift */; };
|
||||||
AAA00022 /* TravelView.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAA10023 /* TravelView.swift */; };
|
AAA00022 /* TravelView.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAA10023 /* TravelView.swift */; };
|
||||||
|
AAA00023 /* CreditsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAA10024 /* CreditsView.swift */; };
|
||||||
/* Unit Tests */
|
/* Unit Tests */
|
||||||
BBB00001 /* MockNetworkSession.swift in Sources */ = {isa = PBXBuildFile; fileRef = BBB10001 /* MockNetworkSession.swift */; };
|
BBB00001 /* MockNetworkSession.swift in Sources */ = {isa = PBXBuildFile; fileRef = BBB10001 /* MockNetworkSession.swift */; };
|
||||||
BBB00002 /* TestHelpers.swift in Sources */ = {isa = PBXBuildFile; fileRef = BBB10002 /* TestHelpers.swift */; };
|
BBB00002 /* TestHelpers.swift in Sources */ = {isa = PBXBuildFile; fileRef = BBB10002 /* TestHelpers.swift */; };
|
||||||
|
|
@ -87,6 +88,7 @@
|
||||||
AAA10021 /* PropertiesView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PropertiesView.swift; sourceTree = "<group>"; };
|
AAA10021 /* PropertiesView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PropertiesView.swift; sourceTree = "<group>"; };
|
||||||
AAA10022 /* NetworkSession.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetworkSession.swift; sourceTree = "<group>"; };
|
AAA10022 /* NetworkSession.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetworkSession.swift; sourceTree = "<group>"; };
|
||||||
AAA10023 /* TravelView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TravelView.swift; sourceTree = "<group>"; };
|
AAA10023 /* TravelView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TravelView.swift; sourceTree = "<group>"; };
|
||||||
|
AAA10024 /* CreditsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CreditsView.swift; sourceTree = "<group>"; };
|
||||||
AAA10000 /* MacTorn.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MacTorn.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
AAA10000 /* MacTorn.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MacTorn.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
/* Unit Test Files */
|
/* Unit Test Files */
|
||||||
BBB10001 /* MockNetworkSession.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MockNetworkSession.swift; sourceTree = "<group>"; };
|
BBB10001 /* MockNetworkSession.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MockNetworkSession.swift; sourceTree = "<group>"; };
|
||||||
|
|
@ -190,6 +192,7 @@
|
||||||
AAA10006 /* SettingsView.swift */,
|
AAA10006 /* SettingsView.swift */,
|
||||||
AAA10007 /* StatusView.swift */,
|
AAA10007 /* StatusView.swift */,
|
||||||
AAA10023 /* TravelView.swift */,
|
AAA10023 /* TravelView.swift */,
|
||||||
|
AAA10024 /* CreditsView.swift */,
|
||||||
AAA10017 /* MoneyView.swift */,
|
AAA10017 /* MoneyView.swift */,
|
||||||
AAA10018 /* AttacksView.swift */,
|
AAA10018 /* AttacksView.swift */,
|
||||||
AAA10019 /* FactionView.swift */,
|
AAA10019 /* FactionView.swift */,
|
||||||
|
|
@ -441,6 +444,7 @@
|
||||||
AAA00020 /* PropertiesView.swift in Sources */,
|
AAA00020 /* PropertiesView.swift in Sources */,
|
||||||
AAA00021 /* NetworkSession.swift in Sources */,
|
AAA00021 /* NetworkSession.swift in Sources */,
|
||||||
AAA00022 /* TravelView.swift in Sources */,
|
AAA00022 /* TravelView.swift in Sources */,
|
||||||
|
AAA00023 /* CreditsView.swift in Sources */,
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -21,15 +21,18 @@ struct MenuBarLabel: View {
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
// Show airplane + flag + countdown when traveling
|
// Show airplane + flag + countdown when traveling
|
||||||
if let travel = appState.data?.travel,
|
Group {
|
||||||
travel.isTraveling {
|
if let travel = appState.data?.travel,
|
||||||
let destination = travel.destination ?? "?"
|
travel.isTraveling {
|
||||||
let flag = flagForDestination(destination)
|
let destination = travel.destination ?? "?"
|
||||||
let time = formatShortTime(appState.travelSecondsRemaining)
|
let flag = flagForDestination(destination)
|
||||||
Text("✈️\(flag)\(time)")
|
let time = formatShortTime(appState.travelSecondsRemaining)
|
||||||
} else {
|
Text("✈️\(flag)\(time)")
|
||||||
Image(systemName: menuBarIcon)
|
} else {
|
||||||
|
Image(systemName: menuBarIcon)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
.transaction { $0.animation = nil }
|
||||||
}
|
}
|
||||||
|
|
||||||
private var menuBarIcon: String {
|
private var menuBarIcon: String {
|
||||||
|
|
|
||||||
|
|
@ -136,7 +136,7 @@ struct StatusView: View {
|
||||||
Text(travel.isTraveling ? "Traveling to \(travel.destination ?? "Unknown")" : "In \(travel.destination ?? "Unknown")")
|
Text(travel.isTraveling ? "Traveling to \(travel.destination ?? "Unknown")" : "In \(travel.destination ?? "Unknown")")
|
||||||
.font(.caption.bold())
|
.font(.caption.bold())
|
||||||
}
|
}
|
||||||
|
|
||||||
if travel.isTraveling {
|
if travel.isTraveling {
|
||||||
HStack {
|
HStack {
|
||||||
Text("Arriving in:")
|
Text("Arriving in:")
|
||||||
|
|
@ -152,6 +152,7 @@ struct StatusView: View {
|
||||||
.frame(maxWidth: .infinity, alignment: .leading)
|
.frame(maxWidth: .infinity, alignment: .leading)
|
||||||
.background(Color.blue.opacity(0.1))
|
.background(Color.blue.opacity(0.1))
|
||||||
.cornerRadius(8)
|
.cornerRadius(8)
|
||||||
|
.transaction { $0.animation = nil }
|
||||||
}
|
}
|
||||||
|
|
||||||
// MARK: - Bars
|
// MARK: - Bars
|
||||||
|
|
|
||||||
|
|
@ -74,6 +74,7 @@ struct FlyingStatusView: View {
|
||||||
.padding()
|
.padding()
|
||||||
.background(Color.blue.opacity(0.1))
|
.background(Color.blue.opacity(0.1))
|
||||||
.cornerRadius(12)
|
.cornerRadius(12)
|
||||||
|
.transaction { $0.animation = nil }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue