Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

mobile: fix attachments progress

Ammar Ahmed15aab4ec29e1
diff --git a/apps/mobile/app/common/filesystem/download-attachment.js b/apps/mobile/app/common/filesystem/download-attachment.js
index 899f33d99..57f563685 100644
--- a/apps/mobile/app/common/filesystem/download-attachment.js
+++ b/apps/mobile/app/common/filesystem/download-attachment.js
@@ -180,7 +180,7 @@ export async function downloadAttachments(attachments) {
current: 0,
total: 0,
message: undefined,
- success: true,
+ success: false,
groupId
});
releasePermissions(outputFolder);
diff --git a/apps/mobile/app/components/attachments/index.tsx b/apps/mobile/app/components/attachments/index.tsx
index 1d98a36fd..e56267295 100644
--- a/apps/mobile/app/components/attachments/index.tsx
+++ b/apps/mobile/app/components/attachments/index.tsx
@@ -34,7 +34,7 @@ import create from "zustand";
import { db } from "../../common/database";
import filesystem from "../../common/filesystem";
import { downloadAttachments } from "../../common/filesystem/download-attachment";
-import { AttachmentGroupProgress } from "../../screens/settings/offline-mode-progress";
+import { AttachmentGroupProgress } from "../../screens/settings/attachment-group-progress";
import { presentSheet, ToastManager } from "../../services/event-manager";
import { useAttachmentStore } from "../../stores/use-attachment-store";
import { SIZE } from "../../utils/size";
diff --git a/apps/mobile/app/screens/settings/offline-mode-progress.tsx b/apps/mobile/app/screens/settings/attachment-group-progress.tsx
similarity index 99%
rename from apps/mobile/app/screens/settings/offline-mode-progress.tsx
rename to apps/mobile/app/screens/settings/attachment-group-progress.tsx
index b45fa9e94..315e307f9 100644
--- a/apps/mobile/app/screens/settings/offline-mode-progress.tsx
+++ b/apps/mobile/app/screens/settings/attachment-group-progress.tsx
@@ -39,7 +39,6 @@ export const AttachmentGroupProgress = (props: { groupId?: string }) => {
const [fileProgress] = useAttachmentProgress(file, false);
return !progress ||
- progress.success ||
progress.canceled ||
progress.current === progress.total ? null : (
<View
diff --git a/apps/mobile/app/screens/settings/components.tsx b/apps/mobile/app/screens/settings/components.tsx
index ece6796d9..2325b8353 100644
--- a/apps/mobile/app/screens/settings/components.tsx
+++ b/apps/mobile/app/screens/settings/components.tsx
@@ -23,7 +23,7 @@ import { AccentColorPicker } from "./appearance";
import DebugLogs from "./debug";
import { ConfigureToolbar } from "./editor/configure-toolbar";
import { Licenses } from "./licenses";
-import { AttachmentGroupProgress } from "./offline-mode-progress";
+import { AttachmentGroupProgress } from "./attachment-group-progress";
import {
ApplockTimerPicker,
BackupReminderPicker,
@@ -40,6 +40,7 @@ import SoundPicker from "./sound-picker";
import { Subscription } from "./subscription";
import ThemeSelector from "./theme-selector";
import { TitleFormat } from "./title-format";
+import { View } from "react-native";
export const components: { [name: string]: ReactElement } = {
colorpicker: <AccentColorPicker />,
@@ -61,5 +62,9 @@ export const components: { [name: string]: ReactElement } = {
backuprestore: <RestoreBackup />,
"server-config": <ServersConfiguration />,
"attachments-manager": <AttachmentDialog note={undefined} isSheet={false} />,
- "offline-mode-progress": <AttachmentGroupProgress groupId="offline-mode" />
+ "offline-mode-progress": (
+ <View style={{ paddingHorizontal: 12 }}>
+ <AttachmentGroupProgress groupId="offline-mode" />
+ </View>
+ )
};