diff --git a/main.meta.js b/main.meta.js index bb3576b..eaebbef 100644 --- a/main.meta.js +++ b/main.meta.js @@ -1,7 +1,7 @@ // ==UserScript== // @name PNGExtraEmbed // @namespace https://coom.tech/ -// @version 0.184 +// @version 0.185 // @description uhh // @author You // @match https://boards.4channel.org/* diff --git a/main.user.js b/main.user.js index f97f10f..143fa51 100644 --- a/main.user.js +++ b/main.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name PNGExtraEmbed // @namespace https://coom.tech/ -// @version 0.184 +// @version 0.185 // @description uhh // @author You // @match https://boards.4channel.org/* @@ -81,7 +81,7 @@ var define_BUILD_VERSION_default; var init_define_BUILD_VERSION = __esm({ ""() { - define_BUILD_VERSION_default = [0, 184]; + define_BUILD_VERSION_default = [0, 185]; } }); @@ -18705,7 +18705,7 @@ // src/stores.ts var localLoad = (key, def) => "__pee__" + key in localStorage ? JSON.parse(localStorage.getItem("__pee__" + key)) : def; var localSet = (key, value) => localStorage.setItem("__pee__" + key, JSON.stringify(value)); - var settings = writable(localLoad("settingsv2", { + var initial_settings = localLoad("settingsv2", { ...localLoad("settings", {}), loop: true, dh: false, @@ -18778,7 +18778,8 @@ } ], ...localLoad("settingsv2", {}) - })); + }); + var settings = writable(initial_settings); var appState = writable({ isCatalog: false, is4chanX: false, @@ -27653,7 +27654,7 @@ // src/main.ts var qp; - var csettings5; + var csettings5 = initial_settings; var processors = [thirdeye_default, pomf_default, pngv3_default, jpg_default, webm_default, gif_default]; var cappState; settings.subscribe(async (b) => { diff --git a/src/main.ts b/src/main.ts index 2c6532c..bd8e001 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,5 +1,5 @@ import { Buffer } from "buffer"; -import { appState, settings } from "./stores"; +import { appState, settings, initial_settings } from "./stores"; import _ from 'lodash'; import globalCss from './global.css'; @@ -33,7 +33,7 @@ export interface ImageProcessor { } let qp: QueryProcessor; -export let csettings: Parameters[0]; +export let csettings: Parameters[0] = initial_settings; let processors: ImageProcessor[] = [thirdeye, pomf, pngv3, jpg, webm, gif]; diff --git a/src/stores.ts b/src/stores.ts index f31214a..ae0d3e2 100644 --- a/src/stores.ts +++ b/src/stores.ts @@ -10,7 +10,7 @@ export const localLoad = (key: string, def: T) => const localSet = (key: string, value: any) => localStorage.setItem('__pee__' + key, JSON.stringify(value)); -export const settings = writable(localLoad('settingsv2', { +export const initial_settings = localLoad('settingsv2', { ...localLoad('settings', {}), loop: true, dh: false, @@ -82,7 +82,9 @@ export const settings = writable(localLoad('settingsv2', { view: 'https://booru.allthefallen.moe/posts/' }] as (Omit & {view: string, disabled?: boolean})[], ...localLoad('settingsv2', {}), -})); +}); + +export const settings = writable(initial_settings); export const appState = writable({ isCatalog: false,