mirror of
https://github.com/nimbold/Firelink.git
synced 2026-08-27 19:17:13 +00:00
fix: pass UUID as String for download properties WindowGroup to prevent routing failures
This commit is contained in:
@@ -0,0 +1,21 @@
|
|||||||
|
with open("Sources/Firelink/FirelinkApp.swift", "r") as f:
|
||||||
|
app_content = f.read()
|
||||||
|
|
||||||
|
old_group = ''' WindowGroup("Download Properties", id: "download-properties", for: UUID.self) { $downloadID in
|
||||||
|
if let downloadID {'''
|
||||||
|
new_group = ''' WindowGroup("Download Properties", id: "download-properties", for: String.self) { $downloadIDString in
|
||||||
|
if let idString = downloadIDString, let downloadID = UUID(uuidString: idString) {'''
|
||||||
|
app_content = app_content.replace(old_group, new_group)
|
||||||
|
|
||||||
|
with open("Sources/Firelink/FirelinkApp.swift", "w") as f:
|
||||||
|
f.write(app_content)
|
||||||
|
|
||||||
|
with open("Sources/Firelink/DownloadTable.swift", "r") as f:
|
||||||
|
table_content = f.read()
|
||||||
|
|
||||||
|
old_open1 = 'openWindow(id: "download-properties", value: item.id)'
|
||||||
|
new_open1 = 'openWindow(id: "download-properties", value: item.id.uuidString)'
|
||||||
|
table_content = table_content.replace(old_open1, new_open1)
|
||||||
|
|
||||||
|
with open("Sources/Firelink/DownloadTable.swift", "w") as f:
|
||||||
|
f.write(table_content)
|
||||||
@@ -165,7 +165,7 @@ struct DownloadTable: View {
|
|||||||
if item.status == .completed {
|
if item.status == .completed {
|
||||||
openFile(item)
|
openFile(item)
|
||||||
} else {
|
} else {
|
||||||
openWindow(id: "download-properties", value: item.id)
|
openWindow(id: "download-properties", value: item.id.uuidString)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -115,8 +115,8 @@ struct FirelinkApp: App {
|
|||||||
}
|
}
|
||||||
.windowResizability(.contentSize)
|
.windowResizability(.contentSize)
|
||||||
|
|
||||||
WindowGroup("Download Properties", id: "download-properties", for: UUID.self) { $downloadID in
|
WindowGroup("Download Properties", id: "download-properties", for: String.self) { $downloadIDString in
|
||||||
if let downloadID {
|
if let idString = downloadIDString, let downloadID = UUID(uuidString: idString) {
|
||||||
DownloadPropertiesWindow(downloadID: downloadID)
|
DownloadPropertiesWindow(downloadID: downloadID)
|
||||||
.environmentObject(controller)
|
.environmentObject(controller)
|
||||||
.environmentObject(settings)
|
.environmentObject(settings)
|
||||||
|
|||||||
Reference in New Issue
Block a user