code refactoring, enabled memory db persist to fs.

This commit is contained in:
2023-05-25 11:13:46 +02:00
parent acfc5aa064
commit fd0b40ac46
10 changed files with 82 additions and 17 deletions

View File

@@ -32,7 +32,7 @@ import { RootState, store } from './stores/store'
import AppBar from './components/AppBar'
import Drawer from './components/Drawer'
import Downloaded from './Downloaded'
import Archive from './Archive'
import { formatGiB } from './utils'
function AppContent() {
@@ -148,7 +148,7 @@ function AppContent() {
<ListItemIcon>
<DownloadIcon />
</ListItemIcon>
<ListItemText primary="Downloaded" />
<ListItemText primary="Archive" />
</ListItemButton>
</Link>
<Link to={'/settings'} style={
@@ -188,7 +188,7 @@ function AppContent() {
} />
<Route path="/archive" element={
<Suspense fallback={<CircularProgress />}>
<Downloaded />
<Archive />
</Suspense>
} />
</Routes>

View File

@@ -130,7 +130,11 @@ export default function Downloaded() {
icon={<DeleteForeverIcon />}
tooltipTitle={`Delete selected`}
tooltipOpen
onClick={() => setOpenDialog(true)}
onClick={() => {
if (selected$.value.length > 0) {
setOpenDialog(true)
}
}}
/>
</SpeedDial>
<Dialog

View File

@@ -6,7 +6,7 @@ import { StackableResult } from "./StackableResult"
type Props = {
downloads: RPCResult[]
abortFunction: Function
abortFunction: (id: string) => void
}
export function DownloadsCardView({ downloads, abortFunction }: Props) {

View File

@@ -1,4 +1,4 @@
import { EightK, FourK, Hd, Sd } from "@mui/icons-material";
import { EightK, FourK, Hd, Sd } from '@mui/icons-material'
import {
Button,
Card,
@@ -11,9 +11,9 @@ import {
Skeleton,
Stack,
Typography
} from "@mui/material";
import { useEffect, useState } from "react";
import { ellipsis, formatSpeedMiB, roundMiB } from "../utils";
} from '@mui/material'
import { useEffect, useState } from 'react'
import { ellipsis, formatSpeedMiB, roundMiB } from '../utils'
type Props = {
title: string,
@@ -97,7 +97,8 @@ export function StackableResult({
variant="contained"
size="small"
color="primary"
onClick={stopCallback}>
onClick={stopCallback}
>
{isCompleted ? "Clear" : "Stop"}
</Button>
</CardActions>