refactor: improve code formatting and consistency across components

- Updated button and span elements in ThemeToggle.vue and TopActions.vue for better readability.
- Enhanced UninstallConfirmModal.vue and UpdateAppsModal.vue with consistent indentation and spacing.
- Refactored downloadStatus.ts and storeConfig.ts for improved code clarity.
- Standardized string quotes and spacing in typedefinition.ts and processInstall.ts.
- Ensured consistent use of arrow functions and improved variable declarations throughout the codebase.
This commit is contained in:
Elysia
2026-02-12 18:32:41 +08:00
parent e11740ad4c
commit 6622e70033
29 changed files with 1681 additions and 1042 deletions
+10 -10
View File
@@ -1,22 +1,22 @@
import { computed,ComputedRef,ref,unref,watch } from "vue";
import type { DownloadItem,DownloadItemStatus } from "./typedefinition";
import { computed, ComputedRef, ref, unref, watch } from "vue";
import type { DownloadItem, DownloadItemStatus } from "./typedefinition";
export const downloads = ref<DownloadItem[]>([]);
export function removeDownloadItem(pkgname:string) {
export function removeDownloadItem(pkgname: string) {
const list = downloads.value;
for (let i = list.length - 1; i >= 0; i -= 1) {
if (list[i].pkgname === pkgname) {
list.splice(i,1);
list.splice(i, 1);
}
}
}
export function watchDownloadsChange (cb: () => void) {
const statusById = new Map<number,DownloadItemStatus>();
export function watchDownloadsChange(cb: () => void) {
const statusById = new Map<number, DownloadItemStatus>();
for (const item of downloads.value) {
statusById.set(item.id,item.status);
statusById.set(item.id, item.status);
}
watch(
@@ -27,7 +27,7 @@ export function watchDownloadsChange (cb: () => void) {
if (item.status === "completed" && prevStatus !== "completed") {
cb();
}
statusById.set(item.id,item.status);
statusById.set(item.id, item.status);
}
if (statusById.size > list.length) {
@@ -42,7 +42,7 @@ export function watchDownloadsChange (cb: () => void) {
);
}
export function useDownloadItemStatus (
export function useDownloadItemStatus(
pkgname?: ComputedRef<string | undefined>,
) {
const status: ComputedRef<DownloadItemStatus | undefined> = computed(() => {
@@ -63,7 +63,7 @@ export function useDownloadItemStatus (
};
}
export function useInstallFeedback (pkgname?: ComputedRef<string | undefined>) {
export function useInstallFeedback(pkgname?: ComputedRef<string | undefined>) {
const installFeedback = computed(() => {
const name = unref(pkgname);
if (!name) return false;