Skip to content

Commit 27b0c19

Browse files
author
leminlimez
committed
hide update prompt in higher versions
1 parent 6e4ad19 commit 27b0c19

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

TrollTools/Other/TrollToolsApp.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ struct TrollToolsApp: App {
1313
WindowGroup {
1414
RootView()
1515
.onAppear {
16-
if let version = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String, let url = URL(string: "https://api.github.com/repos/sourcelocation/TrollTools/releases/latest") {
16+
if let version = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? Double, let url = URL(string: "https://api.github.com/repos/sourcelocation/TrollTools/releases/latest") {
1717
let task = URLSession.shared.dataTask(with: url) {(data, response, error) in
1818
guard let data = data else { return }
1919

2020
if let json = try? JSONSerialization.jsonObject(with: data, options: .mutableContainers) as? [String: Any] {
21-
if json["tag_name"] as? String != version {
21+
if json["tag_name"] as? Double ?? 2.1 > version {
2222
UIApplication.shared.confirmAlert(title: "Update available", body: "A new TrollTools update is available, do you want to visit releases page?", onOK: {
2323
UIApplication.shared.open(URL(string: "https://github.com/sourcelocation/TrollTools/releases/latest")!)
2424
}, noCancel: false)

0 commit comments

Comments
 (0)