Skip to content
This repository was archived by the owner on Oct 18, 2023. It is now read-only.

Commit 53d053e

Browse files
committed
style: update splash information on download
1 parent c1daddd commit 53d053e

File tree

4 files changed

+14
-8
lines changed

4 files changed

+14
-8
lines changed

main/background.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ if (isProd) {
6969
})
7070

7171
autoUpdater.on("download-progress", (progress) => {
72-
splashWindow.webContents.send("update-progress", progress.percent)
72+
splashWindow.webContents.send("update-progress", progress)
7373
})
7474

7575
if(isProd) {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"private": true,
33
"name": "lock-pass",
44
"description": "A simple password manager",
5-
"version": "1.3.0",
5+
"version": "1.3.1",
66
"author": "Nemika Hajbour <nemika@bytestobits.dev>",
77
"repository": {
88
"type": "git",

renderer/components/Menu.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ export default function Menu() {
2929
className={"e-drag"}
3030
justifyContent={"space-between"}
3131
alignItems={"center"}
32+
zIndex={9999}
3233
>
3334
<Image src="/images/icon.png" boxSize="20px" m={2} />
3435

renderer/pages/splash.tsx

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import { AbsoluteCenter, Button, Flex, Heading, Image, Progress } from "@chakra-ui/react";
1+
import { AbsoluteCenter, Button, Flex, Heading, Image, Progress, Text } from "@chakra-ui/react";
22
import { useEffect, useState } from "react";
33

44
import electron from "electron"
55

66
export default function SplashScreen() {
77
const [loading, setLoading] = useState(true)
88
const [loadingText, setLoadingText] = useState("Loading...")
9-
const [downloadProgress, setDownloadProgress] = useState(null)
9+
const [downloadProgressData, setDownloadProgressData] = useState(null)
1010
const [firstFetch, FirstFetch] = useState(false)
1111

1212
useEffect(() => {
@@ -18,7 +18,7 @@ export default function SplashScreen() {
1818
electron.ipcRenderer.on('load-window', () => setLoading(false))
1919
electron.ipcRenderer.on('update-progress', (event, progress) => {
2020
setLoadingText("Downloading update...")
21-
setDownloadProgress(progress)
21+
setDownloadProgressData(progress)
2222
})
2323
electron.ipcRenderer.send('check-updates')
2424
setLoadingText("Checking for updates...")
@@ -52,11 +52,16 @@ export default function SplashScreen() {
5252

5353
onClick={() => electron.ipcRenderer.send('open-main')}
5454
>
55-
Open Manager
55+
Open Manager
5656
</Button>
5757

58-
{downloadProgress && (
59-
<Progress mt={5} w="50%" rounded="md" hasStripe value={downloadProgress} isAnimated colorScheme="green" />
58+
{downloadProgressData && (
59+
<>
60+
<Progress mt={5} w="50%" rounded="md" hasStripe value={downloadProgressData.percent} isAnimated colorScheme="green" />
61+
<Text textAlign={"center"} fontStyle="italic" fontSize="14px" color="gray">
62+
{downloadProgressData.transferred}/{downloadProgressData.total} ({(downloadProgressData.bytesPerSecond/1000000).toFixed(2)} mb/s)
63+
</Text>
64+
</>
6065
)}
6166
</Flex>
6267
</AbsoluteCenter>

0 commit comments

Comments
 (0)