Files
damus/damus/Notify/PurpleAccountUpdateNotify.swift
T
Daniel D’Aquino 5f9477d55b purple: notify main DamusPurpleView when user gets a subsscription
Previously, if the user had the DamusPurpleView open and bought the
subscription, the DamusPurpleView would not change. It would stay in the
marketing pitch screen.

This commit makes sure that this view is automatically updated as soon
as the user sees the welcome screen, so that they can see their account
info in case they have DamusPurpleView open.

Testing
--------

PASS

iOS: 17.2
Damus: This commit
damus-api: Varying versions around `9a6af62`
Coverage:
1. Checked the entire LN flow through the local test environment using the simulator
2. Checked all LN flow views on both light and dark mode to ensure it looks good
3. Checked the entire LN flow using the staging environment using a physical iOS device

Closes: https://github.com/damus-io/damus/issues/1899
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
Reviewed-by: William Casarin <jb55@jb55.com>
Signed-off-by: William Casarin <jb55@jb55.com>
2024-01-30 10:29:49 -08:00

26 lines
569 B
Swift
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
//
// PurpleAccountUpdateNotify.swift
// damus
//
// Created by Daniel DAquino on 2024-01-29.
//
import Foundation
struct PurpleAccountUpdateNotify: Notify {
typealias Payload = DamusPurple.Account
var payload: DamusPurple.Account
}
extension NotifyHandler {
static var purple_account_update: NotifyHandler<PurpleAccountUpdateNotify> {
.init()
}
}
extension Notifications {
static func purple_account_update(_ result: DamusPurple.Account) -> Notifications<PurpleAccountUpdateNotify> {
.init(.init(payload: result))
}
}