Fix inbox show all and align group filters

This commit is contained in:
Rūdolfs Ošiņš
2026-05-19 17:16:09 +02:00
parent d00a99d670
commit 7ea1f580c8
3 changed files with 7 additions and 4 deletions
+4 -1
View File
@@ -157,7 +157,7 @@ impl InboxStorage for Sqlite {
Some(repos) if !repos.is_empty() => {
let placeholders: Vec<String> =
(1..=repos.len()).map(|i| format!("?{}", i)).collect();
format!("WHERE repo IN ({})", placeholders.join(","))
format!("AND repo IN ({})", placeholders.join(","))
}
_ => String::from(""),
};
@@ -175,6 +175,9 @@ impl InboxStorage for Sqlite {
) as value,
MAX(timestamp) AS latest_timestamp
FROM 'repository-notifications'
WHERE new NOT NULL
AND (ref LIKE '%cobs/xyz.radicle.patch%'
OR ref LIKE '%cobs/xyz.radicle.issue%')
{}
GROUP BY repo, ref_without_namespace
ORDER BY latest_timestamp DESC",
+1 -1
View File
@@ -88,7 +88,7 @@ export async function loadInbox(): Promise<LoadedInboxRoute> {
const [sidebarData, notificationsByRepo] = await Promise.all([
loadSidebarData(),
invoke<NotificationsByRepo[]>("list_notifications", {
params: { take: 100 },
params: { take: 20 },
}),
]);
return {
+2 -2
View File
@@ -69,13 +69,13 @@
async function loadNotifications() {
notificationsByRepo = await invoke<NotificationsByRepo[]>(
"list_notifications",
{ params: { take: 100 } },
{ params: { take: 20 } },
);
}
async function showAll(rid: string) {
const all = await invoke<NotificationsByRepo[]>("list_notifications", {
params: { repos: [rid] },
params: { repos: [rid], all: true },
});
notificationsByRepo = [
...notificationsByRepo.filter(r => r.rid !== rid),