Skip to content

Commit

Permalink
refactor: 删除一些不必要的类型声明
Browse files Browse the repository at this point in the history
  • Loading branch information
lanyeeee committed May 18, 2024
1 parent 8c3d6c2 commit cd65174
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions frontend/src/components/download/DownloadSearchBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ async function onSearch() {
try {
loading.value = true
const response: types.Response = await SearchComicInfo(comicId, store.proxyUrl, store.cacheDirectory)
const response = await SearchComicInfo(comicId, store.proxyUrl, store.cacheDirectory)
if (response.code != 0) {
notification.create({type: "error", title: "搜索失败", meta: response.msg,})
return
}
const root: types.TreeNode = response.data
console.log("搜索结果", root)
const rootOption: TreeOption = buildOptionTree(root)
const rootOption = buildOptionTree(root)
store.downloadTreeOptions = [rootOption]
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/export/ExportRefreshButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ async function onRefresh() {
try {
loading.value = true
const response: types.Response = await ScanCacheDir(store.cacheDirectory, store.exportDirectory, store.exportTreeMaxDepth)
const response = await ScanCacheDir(store.cacheDirectory, store.exportDirectory, store.exportTreeMaxDepth)
if (response.code != 0) {
notification.create({type: "error", title: "扫描缓存目录失败", content: response.msg})
return
Expand All @@ -55,7 +55,7 @@ async function onRefresh() {
store.exportDefaultCheckedKeys.length = 0
store.exportDefaultExpandKeys.length = 0
for (const root of roots) {
const rootOption: TreeOption = await buildOptionTree(root)
const rootOption = await buildOptionTree(root)
exportTreeOptions.push(rootOption)
}
Expand Down
5 changes: 2 additions & 3 deletions frontend/src/components/settings/SettingsPane.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<script setup lang="ts">
import {onMounted, ref} from "vue"
import {useNotification} from "naive-ui"
import {types} from "../../../wailsjs/go/models"
import {useDownloaderStore} from "../../stores/downloader"
import {GetCpuNum} from "../../../wailsjs/go/api/UtilsApi"
import {ChooseDirectory} from "../../../wailsjs/go/api/SettingsApi"
Expand All @@ -16,7 +15,7 @@ onMounted(async () => {
})
async function onChooseCacheDirectory() {
const response: types.Response = await ChooseDirectory(store.cacheDirectory)
const response = await ChooseDirectory(store.cacheDirectory)
if (response.code != 0) {
notification.create({type: "error", title: "选择缓存目录失败", meta: response.msg,})
} else if (response.data !== "") {
Expand All @@ -26,7 +25,7 @@ async function onChooseCacheDirectory() {
}
async function onChooseExportDirectory() {
const response: types.Response = await ChooseDirectory(store.exportDirectory)
const response = await ChooseDirectory(store.exportDirectory)
if (response.code != 0) {
notification.create({type: "error", title: "选择导出目录失败", meta: response.msg,})
} else if (response.data !== "") {
Expand Down

0 comments on commit cd65174

Please sign in to comment.