diff --git a/radicle-cli/examples/rad-inbox.md b/radicle-cli/examples/rad-inbox.md index bdcdb807..13a714a8 100644 --- a/radicle-cli/examples/rad-inbox.md +++ b/radicle-cli/examples/rad-inbox.md @@ -85,7 +85,7 @@ $ rad inbox show 1 ``` ``` ~alice -$ rad inbox clear +$ rad inbox clear 1 2 ✓ Cleared 2 item(s) from your inbox $ rad inbox Your inbox is empty. diff --git a/radicle/src/node/notifications/store.rs b/radicle/src/node/notifications/store.rs index eb6f240f..ac7c3750 100644 --- a/radicle/src/node/notifications/store.rs +++ b/radicle/src/node/notifications/store.rs @@ -196,12 +196,16 @@ impl Store { .db .prepare("DELETE FROM `repository-notifications` WHERE rowid = ?")?; + // N.b. we need to keep the count manually since the change count + // will always be `1` because of each reset. + let mut count = 0; for id in ids { stmt.bind((1, *id as i64))?; stmt.next()?; stmt.reset()?; + count += self.db.change_count(); } - Ok(self.db.change_count()) + Ok(count) }) }