From 853ab1ea809b8b1cd84b6237228a0390615257cc Mon Sep 17 00:00:00 2001 From: SpikeHD Date: Thu, 12 May 2022 22:16:32 -0700 Subject: [PATCH] cleanup --- src-tauri/src/downloader.rs | 6 +----- src/ui/App.tsx | 1 - src/ui/components/ServerLaunchSection.tsx | 2 +- src/ui/components/common/DirInput.tsx | 2 +- src/ui/components/common/MainProgressBar.tsx | 2 +- 5 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src-tauri/src/downloader.rs b/src-tauri/src/downloader.rs index 0775c74..86ce3dc 100644 --- a/src-tauri/src/downloader.rs +++ b/src-tauri/src/downloader.rs @@ -1,11 +1,7 @@ use lazy_static::lazy_static; -use tauri::App; -use tauri::Manager; - use std::sync::Mutex; use std::cmp::min; -use std::collections::HashMap; use std::fs::File; use std::io::Write; @@ -14,7 +10,7 @@ use futures_util::StreamExt; // This will create a downloads list that will be used to check if we should continue downloading the file lazy_static!{ static ref DOWNLOADS: Mutex> = { - let mut m = Vec::new(); + let m = Vec::new(); Mutex::new(m) }; } diff --git a/src/ui/App.tsx b/src/ui/App.tsx index 87fcde6..acb1aeb 100644 --- a/src/ui/App.tsx +++ b/src/ui/App.tsx @@ -9,7 +9,6 @@ import DownloadHandler from '../utils/download' // Major Components import TopBar from './components/TopBar' import ServerLaunchSection from './components/ServerLaunchSection' -import ProgressBar from './components/common/ProgressBar' import MainProgressBar from './components/common/MainProgressBar' import Options from './components/menu/Options' import MiniDialog from './components/MiniDialog' diff --git a/src/ui/components/ServerLaunchSection.tsx b/src/ui/components/ServerLaunchSection.tsx index aa7fd1a..4f8e121 100644 --- a/src/ui/components/ServerLaunchSection.tsx +++ b/src/ui/components/ServerLaunchSection.tsx @@ -2,7 +2,7 @@ import React from 'react' import Checkbox from './common/Checkbox' import BigButton from './common/BigButton' import { getConfig, saveConfig } from '../../utils/configuration' -import Tr, { translate } from '../../utils/language' +import { translate } from '../../utils/language' import { invoke } from '@tauri-apps/api/tauri' import './ServerLaunchSection.css' diff --git a/src/ui/components/common/DirInput.tsx b/src/ui/components/common/DirInput.tsx index 607e3e1..b144ef7 100644 --- a/src/ui/components/common/DirInput.tsx +++ b/src/ui/components/common/DirInput.tsx @@ -1,4 +1,4 @@ -import React, { RefObject } from 'react' +import React from 'react' import { open } from '@tauri-apps/api/dialog' import TextInput from './TextInput' import File from '../../../resources/icons/folder.svg' diff --git a/src/ui/components/common/MainProgressBar.tsx b/src/ui/components/common/MainProgressBar.tsx index fe449dc..e514af3 100644 --- a/src/ui/components/common/MainProgressBar.tsx +++ b/src/ui/components/common/MainProgressBar.tsx @@ -30,7 +30,7 @@ export default class ProgressBar extends React.Component { componentDidMount() { // Periodically check the progress of passed file path - const intv = setInterval(() => { + setInterval(() => { const prog = this.props.downloadManager.getTotalAverage() this.setState({ average: prog?.average || 0,