Skip to content

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

mobile: fix loading

ammarahm-ed068a99463db9
diff --git a/apps/mobile/app/components/dialogs/pdf-preview/index.js b/apps/mobile/app/components/dialogs/pdf-preview/index.js
index 5b5673fa5..0c1b72b75 100644
--- a/apps/mobile/app/components/dialogs/pdf-preview/index.js
+++ b/apps/mobile/app/components/dialogs/pdf-preview/index.js
@@ -60,7 +60,7 @@ const PDFPreview = () => {
const pdfRef = useRef();
const [attachment, setAttachment] = useState(null);
const [password, setPassword] = useState("");
- const progress = useAttachmentProgress(attachment);
+ const [progress] = useAttachmentProgress(attachment);
useEffect(() => {
eSubscribeEvent("PDFPreview", open);
@@ -152,9 +152,10 @@ const PDFPreview = () => {
}}
>
<ProgressBarComponent
- indeterminate
+ indeterminate={!progress}
color={colors.accent}
borderColor="transparent"
+ progress={parseInt(progress?.value || "100") / 100}
/>
<Paragraph
style={{
@@ -162,7 +163,8 @@ const PDFPreview = () => {
}}
color={colors.light}
>
- Loading ({progress?.percent || "0%"})... Please wait
+ Loading {`${progress?.percent ? `(${progress?.percent})` : ""}`}
+ ... Please wait
</Paragraph>
</Animated.View>
) : (