Remove client-side isLoggedIn value
[ProtonMail-WebClient.git] / packages / drive-store / patches / 0004-trashDocument.diff
blob31bba20f3512e0eca966de48f7b2e44f99ac3bf2
1 diff --git a/packages/drive-store/store/_actions/useActions.tsx b/packages/drive-store/store/_actions/useActions.tsx
2 index c34027f30d..2e6b22f640 100644
3 --- a/packages/drive-store/store/_actions/useActions.tsx
4 +++ b/packages/drive-store/store/_actions/useActions.tsx
5 @@ -251,7 +251,10 @@ export default function useActions() {
6 createMovedItemsNotifications(linksToMove, result.successes, result.failures, undoAction);
7 };
9 - const trashLinks = async (abortSignal: AbortSignal, linksToTrash: LinkInfo[]) => {
10 + /**
11 + * @param [notify] - whether notification popover should be displayed upon successful trash. Disabled
12 + */
13 + const trashLinks = async (abortSignal: AbortSignal, linksToTrash: LinkInfo[], notify = true) => {
14 if (!linksToTrash.length) {
15 return;
17 @@ -265,6 +268,10 @@ export default function useActions() {
18 }))
21 + if (!notify) {
22 + return;
23 + }
25 // This is a bit ugly, but the photo linkId cache is not connected
26 // very well to the rest of our state.
27 // removePhotosFromCache(result.successes);
28 @@ -282,7 +289,10 @@ export default function useActions() {
29 createTrashedItemsNotifications(linksToTrash, result.successes, result.failures, undoAction);
32 - const restoreLinks = async (abortSignal: AbortSignal, linksToRestore: LinkInfo[]) => {
33 + /**
34 + * @param [notify] - whether notification popover should be displayed upon successful trash. Disabled on Docs
35 + */
36 + const restoreLinks = async (abortSignal: AbortSignal, linksToRestore: LinkInfo[], notify = true) => {
37 if (!linksToRestore.length) {
38 return;
40 @@ -292,6 +302,10 @@ export default function useActions() {
41 linksToRestore.map(({ linkId, rootShareId }) => ({ linkId, shareId: rootShareId }))
44 + if (!notify) {
45 + return;
46 + }
48 const undoAction = async () => {
49 const linksToTrash = result.successes
50 .map((linkId) => linksToRestore.find((link) => link.linkId === linkId))