Browse Source

Fix random loading bug

pull/46/head
coomdev 2 years ago
parent
commit
1cfa74af5b
  1. 2
      main.meta.js
  2. 11
      main.user.js
  3. 4
      src/main.ts
  4. 6
      src/stores.ts

2
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/*

11
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>"() {
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) => {

4
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<typeof settings['set']>[0];
export let csettings: Parameters<typeof settings['set']>[0] = initial_settings;
let processors: ImageProcessor[] =
[thirdeye, pomf, pngv3, jpg, webm, gif];

6
src/stores.ts

@ -10,7 +10,7 @@ export const localLoad = <T>(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<Booru, 'quirks'> & {view: string, disabled?: boolean})[],
...localLoad('settingsv2', {}),
}));
});
export const settings = writable(initial_settings);
export const appState = writable({
isCatalog: false,

Loading…
Cancel
Save