Skip to content

Commit

Permalink
show logout toast
Browse files Browse the repository at this point in the history
  • Loading branch information
mickmaccallum committed Dec 2, 2024
1 parent 58343b9 commit 7b78892
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,15 @@ public struct ParraAlertContent: Hashable, Equatable, Sendable {

// MARK: - Public

public static let defaultSessionExpired: ParraAlertContent = .init(
title: ParraLabelContent(text: "Session expired"),
subtitle: ParraLabelContent(
text: "You have been automatically logged out"
),
icon: .symbol("clock.badge.exclamationmark"),
dismiss: nil
)

public let title: ParraLabelContent
public let subtitle: ParraLabelContent?
public let icon: ParraImageContent?
Expand Down
6 changes: 6 additions & 0 deletions ios/Sources/Parra/Networking/Servers/Auth/AuthService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,12 @@ final class AuthService {
result,
shouldBroadcast: true
)

await ParraAlertManager.shared.showToast(
for: 5.0,
level: .warn,
content: .defaultSessionExpired
)
}

private func performUnauthenticatedLogin(
Expand Down

0 comments on commit 7b78892

Please sign in to comment.