Browse Source

ref: minor stuff

Sv443 1 year ago
parent
commit
164bd42d65
2 changed files with 5 additions and 5 deletions
  1. 3 3
      src/config.ts
  2. 2 2
      src/constants.ts

+ 3 - 3
src/config.ts

@@ -27,7 +27,7 @@ export async function getFeatures(forceRead = false) {
 
 /** Loads a feature configuration saved persistently, returns an empty object if no feature configuration was saved */
 export async function loadFeatureConf(): Promise<FeatureConfig> {
-  const defConf = Object.freeze({ ...defaultFeatures });
+  const defConf = { ...defaultFeatures };
 
   try {
     const featureConf = await GM.getValue("betterytm-config") as string;
@@ -46,13 +46,13 @@ export async function loadFeatureConf(): Promise<FeatureConfig> {
 }
 
 /**
- * Saves a feature configuration saved persistently
+ * Saves the passed feature configuration persistently in GM storage and in the in-memory cache
  * @param featureConf
  */
 export function saveFeatureConf(featureConf: FeatureConfig) {
   if(!featureConf || typeof featureConf != "object")
     throw new TypeError("Feature config not provided or invalid");
-
+ 
   log("Saving new feature config:", featureConf);
   featuresCache = { ...featureConf };
 

+ 2 - 2
src/constants.ts

@@ -1,14 +1,14 @@
 import { LogLevel } from "./types";
 
 /** The branch to use in the @icon, @downloadURL and @updateURL directives */
-export const branch = "develop";
+export const branch = "develop"; // TODO: change in prod.
 // export const branch = "main";
 
 /**
  * How much info should be logged to the devtools console?  
  * 0 = Debug (show everything) or 1 = Info (show only important stuff)
  */
-export const logLevel: LogLevel = 0;
+export const logLevel: LogLevel = 0; // TODO: change in prod.
 /** Specifies the hard limit for repetitive tasks */
 export const triesLimit = 50;
 /** Specifies the interval in ms for repetitive tasks */