Skip to content

Commit 3394423

Browse files
Update OptionView.swift
为添加一个兼容iOS 14系统的警告框,解决在 iOS 14 系统上选择注入 deb 文件进行注入时没有反应
1 parent 8e1280b commit 3394423

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

TrollFools/OptionView.swift

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,24 @@ struct OptionView: View {
6464
}
6565
} else {
6666
wrappedContent
67+
.alert(isPresented: $isWarningPresented) {
68+
guard case .success(let urls) = temporaryResult else {
69+
return Alert(title: Text("Error"))
70+
}
71+
72+
return Alert(
73+
title: Text(NSLocalizedString("Notice", comment: "")),
74+
message: Text(Self.warningMessage(urls)),
75+
primaryButton: .destructive(Text(NSLocalizedString("Continue and Don’t Show Again", comment: ""))) {
76+
importerResult = temporaryResult
77+
isImporterSelected = true
78+
isWarningHidden = true
79+
},
80+
secondaryButton: .cancel() {
81+
temporaryResult = nil
82+
}
83+
)
84+
}
6785
}
6886
}
6987

0 commit comments

Comments
 (0)