mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2025-08-01 05:18:08 +00:00
26 lines
647 B
Rust
26 lines
647 B
Rust
use flowy_derive::ProtoBuf_Enum;
|
|
|
|
use dart_notify::DartNotifyBuilder;
|
|
|
|
const OBSERVABLE_CATEGORY: &'static str = "User";
|
|
|
|
#[derive(ProtoBuf_Enum, Debug)]
|
|
pub(crate) enum UserNotification {
|
|
Unknown = 0,
|
|
UserAuthChanged = 1,
|
|
UserProfileUpdated = 2,
|
|
UserUnauthorized = 3,
|
|
}
|
|
|
|
impl std::default::Default for UserNotification {
|
|
fn default() -> Self { UserNotification::Unknown }
|
|
}
|
|
|
|
impl std::convert::Into<i32> for UserNotification {
|
|
fn into(self) -> i32 { self as i32 }
|
|
}
|
|
|
|
pub(crate) fn dart_notify(id: &str, ty: UserNotification) -> DartNotifyBuilder {
|
|
DartNotifyBuilder::new(id, ty, OBSERVABLE_CATEGORY)
|
|
}
|