mirror of
https://seed.radicle.dev/rad:z4D5UCArafTzTQpDZNQRuqswh3ury.git
synced 2026-10-18 19:10:45 +08:00
Fix inbox show all and align group filters
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user