فهرست منبع

ref: unimportant stuff

Sv443 2 ماه پیش
والد
کامیت
9bfafea396
2فایلهای تغییر یافته به همراه7 افزوده شده و 8 حذف شده
  1. 4 4
      src/features/index.ts
  2. 3 4
      src/serializer.ts

+ 4 - 4
src/features/index.ts

@@ -3,7 +3,7 @@ import { formatNumber, getLocale, getPreferredLocale, getResourceUrl, reloadTab,
 import { clearLyricsCache, getLyricsCache } from "./lyricsCache.js";
 import { doVersionCheck } from "./versionCheck.js";
 import { getFeature, promptResetConfig } from "../config.js";
-import { FeatureInfo, type ColorLightnessPref, type ResourceKey, type SiteSelection, type SiteSelectionOrNone } from "../types.js";
+import { FeatureInfo, LogLevel, type ColorLightnessPref, type ResourceKey, type SiteSelection, type SiteSelectionOrNone } from "../types.js";
 import { emitSiteEvent } from "../siteEvents.js";
 import langMapping from "../../assets/locales.json" with { type: "json" };
 import { showIconToast } from "../components/toast.js";
@@ -801,10 +801,10 @@ export const featInfo = {
     type: "select",
     category: "general",
     options: () => [
-      { value: 0, label: t("log_level_debug") },
-      { value: 1, label: t("log_level_info") },
+      { value: LogLevel.Debug, label: t("log_level_debug") },
+      { value: LogLevel.Info, label: t("log_level_info") },
     ],
-    default: 1,
+    default: LogLevel.Info,
     textAdornment: adornments.reload,
   },
   advancedMode: {

+ 3 - 4
src/serializer.ts

@@ -40,12 +40,11 @@ export async function importData(blob: File | Blob) {
     const data = await blob.text();
     await serializer.deserialize(data);
 
-    const reload = await showPrompt({
+    if(await showPrompt({
       type: "confirm",
       message: t("import_success_confirm_reload"),
-    });
-
-    reload && await reloadTab();
+    }))
+      await reloadTab();
   }
   catch(err) {
     error(err);