iOS: gescannter Einzelstück-Link öffnet wirklich das Stück
Universal Link oeffnete die App, sprang aber nicht aufs Stueck. Jetzt robuster: - Kaltstart wird abgefangen (AppDelegate application(_:continue:) + pending-URL), zusaetzlich zu den SwiftUI-Hooks. - Beim Link wird auf das Server-Profil gewechselt, dessen Adresse zum Host passt (sonst wuerde die UID am falschen Server gesucht). - Schlaegt das Aufloesen fehl (nicht angemeldet, UID unbekannt), erscheint jetzt eine Meldung statt stiller Nichtreaktion. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -140,6 +140,17 @@ final class Session: ObservableObject {
|
||||
loadTokenForActiveProfile()
|
||||
}
|
||||
|
||||
/// Wechselt (falls vorhanden und noetig) auf das Profil, dessen Adresse zum
|
||||
/// Host eines Links passt – damit ein gescannter QR den richtigen Server
|
||||
/// abfragt, auch wenn gerade ein anderer aktiv ist.
|
||||
func switchToProfile(matching url: URL) {
|
||||
guard let host = url.host?.lowercased() else { return }
|
||||
if activeProfile?.url?.host?.lowercased() == host { return }
|
||||
if let match = profiles.first(where: { $0.url?.host?.lowercased() == host }) {
|
||||
switchTo(match.id)
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Anmeldung
|
||||
|
||||
/// Legt die Adresse fuer die Anmeldung fest: aktualisiert das aktive Profil
|
||||
|
||||
Reference in New Issue
Block a user