chore: format code

This commit is contained in:
hayden
2024-11-11 11:39:32 +08:00
parent e36af38375
commit 6904aca24c
30 changed files with 291 additions and 147 deletions

View File

@@ -36,7 +36,7 @@ export const useConfig = defineStore('config', () => {
refresh,
}
useAddConfigSettings(config)
useAddConfigSettings()
return config
})
@@ -49,7 +49,7 @@ declare module 'hooks/store' {
}
}
function useAddConfigSettings(config: Config) {
function useAddConfigSettings() {
onMounted(() => {
// API keys
app.ui?.settings.addSetting({

View File

@@ -1,7 +1,9 @@
import { defineStore } from 'hooks/store'
import { ContainerSize } from 'types/typings'
import { Component, markRaw, ref } from 'vue'
interface HeaderButton {
key: string
icon: string
command: () => void
}

View File

@@ -4,6 +4,13 @@ import { request } from 'hooks/request'
import { defineStore } from 'hooks/store'
import { useToast } from 'hooks/toast'
import { api } from 'scripts/comfyAPI'
import {
BaseModel,
DownloadTask,
DownloadTaskOptions,
SelectOptions,
VersionModel,
} from 'types/typings'
import { bytesToSize } from 'utils/common'
import { onBeforeMount, onMounted, ref, watch } from 'vue'
import { useI18n } from 'vue-i18n'
@@ -385,7 +392,7 @@ class Huggingface extends ModelSearch {
}
class UnknownWebsite extends ModelSearch {
async search(searchUrl: string): Promise<VersionModel[]> {
async search(): Promise<VersionModel[]> {
return Promise.reject(
new Error(
'Unknown Website, please input a URL from huggingface.co or civitai.com.',

View File

@@ -6,6 +6,7 @@ import { defineStore } from 'hooks/store'
import { useToast } from 'hooks/toast'
import { cloneDeep } from 'lodash'
import { app } from 'scripts/comfyAPI'
import { BaseModel, Model, SelectEvent } from 'types/typings'
import { bytesToSize, formatDate, previewUrlToFile } from 'utils/common'
import { ModelGrid } from 'utils/legacy'
import { genModelKey, resolveModelTypeLoader } from 'utils/model'

View File

@@ -13,7 +13,7 @@ export const useStoreProvider = () => {
return storeEvent
}
const storeKeys = new Map<string, Symbol>()
const storeKeys = new Map<string, symbol>()
const getStoreKey = (key: string) => {
let storeKey = storeKeys.get(key)

View File

@@ -12,7 +12,7 @@ export const useToast = () => {
globalToast.value = toast
const wrapperToastError = <T extends Function>(callback: T): T => {
const wrapperToastError = <T extends CallableFunction>(callback: T): T => {
const showToast = (error: Error) => {
toast.add({
severity: 'error',