Skip to content

Commit

Permalink
Update SettingsView.swift
Browse files Browse the repository at this point in the history
两个View中的声明全部统一为了@AppStorage("externalSound") var externalSound: Bool = false,由于之前在SettingsView中已经声明了externalSound却依旧显示cannot find $externalSound in scope,所以只能怀疑声明语句的不同导致了这个问题,因此明确了Bool类型;如果在不同的视图中对同一个@AppStorage属性使用不同的声明方式(即有的明确指定了类型,有的使用了类型推断),可能会导致编译器无法一致地处理该属性,进而导致cannot find $externalSound in scope这样的错误

个人推断,看看这一次CI能不能通过
  • Loading branch information
FengzihangCode committed Aug 28, 2024
1 parent 4272f10 commit 60424c9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion MeowBili/Others/SettingsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ struct SettingsView: View {
@AppStorage("SESSDATA") var sessdata = ""
@AppStorage("bili_jct") var biliJct = ""
@AppStorage("IsLargeSuggestionStyle") var isLargeSuggestionStyle = false
@AppStorage("externalSound") var externalSound = false
@AppStorage("externalSound") var externalSound: Bool = false
@State var isLogoutAlertPresented = false
var body: some View {
List {
Expand Down

0 comments on commit 60424c9

Please sign in to comment.