AddRemoteTimelineView: show error message when instance is invalid (#2105) (#2133)

This commit is contained in:
Klaus Dresbach 2024-07-17 17:30:30 +02:00 committed by GitHub
parent fbff1d6dfe
commit d320caaa4f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 136 additions and 0 deletions

View file

@ -37,6 +37,11 @@ struct AddRemoteTimelineView: View {
.foregroundColor(.green) .foregroundColor(.green)
.listRowBackground(theme.primaryBackgroundColor) .listRowBackground(theme.primaryBackgroundColor)
} }
if !instanceName.isEmpty && instance == nil {
Label("timeline.\(instanceName)-not-valid", systemImage: "xmark.seal.fill")
.foregroundColor(.red)
.listRowBackground(theme.primaryBackgroundColor)
}
Button { Button {
guard instance != nil else { return } guard instance != nil else { return }
context.insert(LocalTimeline(instance: instanceName)) context.insert(LocalTimeline(instance: instanceName))
@ -45,6 +50,7 @@ struct AddRemoteTimelineView: View {
Text("timeline.add.action.add") Text("timeline.add.action.add")
} }
.listRowBackground(theme.primaryBackgroundColor) .listRowBackground(theme.primaryBackgroundColor)
.disabled(instance == nil)
instancesListView instancesListView
} }

View file

@ -701,6 +701,17 @@
} }
} }
}, },
"%@ ist keine valide Instanz" : {
"extractionState" : "stale",
"localizations" : {
"uk" : {
"stringUnit" : {
"state" : "translated",
"value" : "%@ не є дійсним екземпляром"
}
}
}
},
"%@ was posted on Mastodon" : { "%@ was posted on Mastodon" : {
"localizations" : { "localizations" : {
"de" : { "de" : {
@ -78831,6 +78842,125 @@
} }
} }
}, },
"timeline.%@-not-valid" : {
"extractionState" : "manual",
"localizations" : {
"be" : {
"stringUnit" : {
"state" : "translated",
"value" : "%@ не з'яўляецца сапраўдным прыкладам"
}
},
"ca" : {
"stringUnit" : {
"state" : "translated",
"value" : "%@ no és una instància vàlida"
}
},
"de" : {
"stringUnit" : {
"state" : "translated",
"value" : "%@ ist keine gültige Instanz"
}
},
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "%@ is not a valid instance"
}
},
"en-GB" : {
"stringUnit" : {
"state" : "translated",
"value" : "%@ is not a valid instance"
}
},
"es" : {
"stringUnit" : {
"state" : "translated",
"value" : "%@ no es una instancia válida"
}
},
"eu" : {
"stringUnit" : {
"state" : "translated",
"value" : "%@ ez da baliozko instantzia"
}
},
"fr" : {
"stringUnit" : {
"state" : "translated",
"value" : "%@ n'est pas une instance valide"
}
},
"it" : {
"stringUnit" : {
"state" : "translated",
"value" : "%@ non è un'istanza valida"
}
},
"ja" : {
"stringUnit" : {
"state" : "translated",
"value" : "%@ 有効なインスタンスではありません"
}
},
"ko" : {
"stringUnit" : {
"state" : "translated",
"value" : "%@ 유효한 인스턴스가 아닙니다"
}
},
"nb" : {
"stringUnit" : {
"state" : "translated",
"value" : "%@ er ikke en gyldig instans"
}
},
"nl" : {
"stringUnit" : {
"state" : "translated",
"value" : "%@ is geen geldige instantie"
}
},
"pl" : {
"stringUnit" : {
"state" : "translated",
"value" : "%@ nie jest poprawnym serwerem"
}
},
"pt-BR" : {
"stringUnit" : {
"state" : "translated",
"value" : "%@ não é uma instância válida"
}
},
"tr" : {
"stringUnit" : {
"state" : "translated",
"value" : "%@ geçerli bir örnek değil"
}
},
"uk" : {
"stringUnit" : {
"state" : "translated",
"value" : "%@ немає коректний сервера"
}
},
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
"value" : "%@ 不是一个有效的实例"
}
},
"zh-Hant" : {
"stringUnit" : {
"state" : "translated",
"value" : "%@ 不是一個有效的實例"
}
}
}
},
"timeline.add-remote.title" : { "timeline.add-remote.title" : {
"localizations" : { "localizations" : {
"be" : { "be" : {