@remit/web-client 0.0.326 → 0.0.327
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -23,7 +23,7 @@ import { useInfiniteQuery } from "@tanstack/react-query";
|
|
|
23
23
|
import { createContext, useCallback, useContext, useEffect, useMemo, useRef, useState, } from "react";
|
|
24
24
|
import { useArchiveMailbox, useDraftsMailbox, useJunkMailbox, useTrashByAccount, useTrashMailbox, } from "../../hooks/useArchiveMailbox";
|
|
25
25
|
import { useCurrentMailboxMessageCount, useCurrentMailboxName, useCurrentMailboxUnseenCount, } from "../../hooks/useCurrentMailboxName";
|
|
26
|
-
import {
|
|
26
|
+
import { useDeleteMessages } from "../../hooks/useDeleteMessages";
|
|
27
27
|
import { useEmptyTrash } from "../../hooks/useEmptyTrash";
|
|
28
28
|
import { useIntelligenceData } from "../../hooks/useIntelligenceData";
|
|
29
29
|
import { useIntelligenceDrawer } from "../../hooks/useIntelligenceDrawer";
|
|
@@ -191,14 +191,7 @@ function MailboxPaneProvider({ mailboxId, thread, children, }) {
|
|
|
191
191
|
});
|
|
192
192
|
const { accountId: mailboxAccountId, isLoading: mailboxAccountLoading } = useMailboxAccount(mailboxId);
|
|
193
193
|
const mailboxName = useCurrentMailboxName({ accounts });
|
|
194
|
-
|
|
195
|
-
// dedupe spans pages and the deleted drop repeats the server's own
|
|
196
|
-
// `excludeDeleted`, and neither result changes when another page loads.
|
|
197
|
-
// Residual tokens are the exception — the request could not carry them, so
|
|
198
|
-
// they are applied here over what came back. That thins a page rather than
|
|
199
|
-
// answering over the whole mailbox, which is why the empty state stops
|
|
200
|
-
// claiming the folder was read and the escalation predicate is withheld.
|
|
201
|
-
const threads = applyResidualTokens(dropDeletedThreads(dedupeThreadMessages(threadsData?.pages.flatMap((page) => page.items ?? []) ?? [])), residualTokens, mailboxAccountId);
|
|
194
|
+
const threads = applyResidualTokens(dedupeThreadMessages(threadsData?.pages.flatMap((page) => page.items ?? []) ?? []), residualTokens, mailboxAccountId);
|
|
202
195
|
const onSelectFilterCategory = useCallback((id) => {
|
|
203
196
|
setFilterCategory(id);
|
|
204
197
|
}, []);
|
|
@@ -30,8 +30,6 @@ const collectMovableIds = async (mailboxId, alreadyMoved, limit, signal) => {
|
|
|
30
30
|
throwOnError: true,
|
|
31
31
|
});
|
|
32
32
|
for (const item of data.items) {
|
|
33
|
-
if (item.isDeleted)
|
|
34
|
-
continue;
|
|
35
33
|
if (alreadyMoved.has(item.messageId))
|
|
36
34
|
continue;
|
|
37
35
|
if (ids.includes(item.messageId))
|
|
@@ -63,11 +61,7 @@ const liveMessageCount = async (mailboxId, signal) => {
|
|
|
63
61
|
query: { order: "desc", continuationToken },
|
|
64
62
|
throwOnError: true,
|
|
65
63
|
});
|
|
66
|
-
|
|
67
|
-
if (item.isDeleted)
|
|
68
|
-
continue;
|
|
69
|
-
count += 1;
|
|
70
|
-
}
|
|
64
|
+
count += data.items.length;
|
|
71
65
|
if (!data.continuationToken)
|
|
72
66
|
break;
|
|
73
67
|
continuationToken = data.continuationToken;
|
|
@@ -25,15 +25,6 @@ interface UseDeleteMessagesOptions {
|
|
|
25
25
|
* the set are removed.
|
|
26
26
|
*/
|
|
27
27
|
export declare const removeMessagesFromItems: (items: RemitImapThreadMessageResponse[], messageIds: Set<string>) => RemitImapThreadMessageResponse[];
|
|
28
|
-
/**
|
|
29
|
-
* Pure helper: drop soft-deleted rows from a flattened thread list.
|
|
30
|
-
*
|
|
31
|
-
* Belt-and-braces guard against #212. The backend already excludes
|
|
32
|
-
* `isDeleted: true` rows from the inbox listing, but if a regression slips
|
|
33
|
-
* back in (or an eventual-consistency window briefly returns a soft-deleted
|
|
34
|
-
* row) the UI must not show it.
|
|
35
|
-
*/
|
|
36
|
-
export declare const dropDeletedThreads: (items: RemitImapThreadMessageResponse[]) => RemitImapThreadMessageResponse[];
|
|
37
28
|
export declare const useDeleteMessages: ({ mailboxId, threadId, accountId, messages, onAfterOptimisticRemove, }: UseDeleteMessagesOptions) => {
|
|
38
29
|
deleteMessages: (messageIds: string[]) => void;
|
|
39
30
|
isPending: boolean;
|
|
@@ -18,15 +18,6 @@ import { resolveMailboxesForMessages } from "./useMarkAsRead";
|
|
|
18
18
|
* the set are removed.
|
|
19
19
|
*/
|
|
20
20
|
export const removeMessagesFromItems = (items, messageIds) => items.filter((item) => !messageIds.has(item.messageId));
|
|
21
|
-
/**
|
|
22
|
-
* Pure helper: drop soft-deleted rows from a flattened thread list.
|
|
23
|
-
*
|
|
24
|
-
* Belt-and-braces guard against #212. The backend already excludes
|
|
25
|
-
* `isDeleted: true` rows from the inbox listing, but if a regression slips
|
|
26
|
-
* back in (or an eventual-consistency window briefly returns a soft-deleted
|
|
27
|
-
* row) the UI must not show it.
|
|
28
|
-
*/
|
|
29
|
-
export const dropDeletedThreads = (items) => items.filter((item) => item.isDeleted !== true);
|
|
30
21
|
export const useDeleteMessages = ({ mailboxId, threadId, accountId, messages, onAfterOptimisticRemove, }) => {
|
|
31
22
|
const queryClient = useQueryClient();
|
|
32
23
|
const { pushError } = useErrorBanners();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remit/web-client",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.327",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Remit web client, published as composable primitives — the app shell, auth shells, and runtime config. A distributor imports what it composes and bundles it.",
|
|
6
6
|
"exports": {
|