Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
REVIEW: more cache -> notifs renaming
Fintan Halpenny committed 6 months ago
commit 13ac93fed99a45683fde9c0fc6c1392f05be01da
parent 76f5131a10b365c705a455090816e9d9c2a46dd7
1 file changed +7 -7
modified crates/radicle-cli/src/commands/inbox.rs
@@ -29,7 +29,7 @@ use args::{ClearMode, Command, ListArgs, ListMode, SortBy};
pub fn run(args: Args, ctx: impl term::Context) -> anyhow::Result<()> {
    let profile = ctx.profile()?;
    let storage = &profile.storage;
-
    let mut cache = profile.notifications_mut()?;
+
    let mut notifs = profile.notifications_mut()?;
    let command = args
        .clone()
        .command
@@ -41,7 +41,7 @@ pub fn run(args: Args, ctx: impl term::Context) -> anyhow::Result<()> {
            reverse,
            show_unknown,
        }) => list(
-
            &cache.read_only(),
+
            &notifs.read_only(),
            args.list_mode(),
            sort_by,
            reverse,
@@ -49,8 +49,8 @@ pub fn run(args: Args, ctx: impl term::Context) -> anyhow::Result<()> {
            storage,
            &profile,
        ),
-
        Command::Clear { ids } => clear(&mut cache, args.clear_mode(ids)),
-
        Command::Show { id } => show(&mut cache, id, storage, &profile),
+
        Command::Clear { ids } => clear(&mut notifs, args.clear_mode(ids)),
+
        Command::Show { id } => show(&mut notifs, id, storage, &profile),
    }
}

@@ -151,15 +151,15 @@ where
    let issues = term::cob::issues(profile, &repo)?;
    let patches = term::cob::patches(profile, &repo)?;

-
    let mut cache = notifs
+
    let mut notifs = notifs
        .by_repo(&rid, &sort_by.to_string())?
        .collect::<Vec<_>>();
    if !reverse {
        // Notifications are returned in descendant order by default.
-
        cache.reverse();
+
        notifs.reverse();
    }

-
    let table = cache.into_iter().flat_map(|n| {
+
    let table = notifs.into_iter().flat_map(|n| {
        let n: Notification = match n {
            Err(e) => return Some(Err(anyhow::Error::from(e))),
            Ok(n) => n,