From e0b99405356dfb2cab1e4a4410de1bc0f2a8a023 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Wed, 5 Feb 2025 08:47:41 +0200 Subject: [PATCH 1/5] remove stuff --- src/services/style_setter/style_setter.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/services/style_setter/style_setter.js b/src/services/style_setter/style_setter.js index 7f071a1fc..63fb0a138 100644 --- a/src/services/style_setter/style_setter.js +++ b/src/services/style_setter/style_setter.js @@ -2,11 +2,8 @@ import { init, getEngineChecksum } from '../theme_data/theme_data_3.service.js' import { getCssRules } from '../theme_data/css_utils.js' import { defaultState } from 'src/modules/default_config_state.js' import { chunk } from 'lodash' -import pako from 'pako' import localforage from 'localforage' -console.log('CONFIG', defaultState) - // On platforms where this is not supported, it will return undefined // Otherwise it will return an array const supportsAdoptedStyleSheets = !!document.adoptedStyleSheets @@ -208,7 +205,6 @@ const extractStyleConfig = ({ return result } -console.log(defaultState) const defaultStyleConfig = extractStyleConfig(defaultState) export const applyConfig = (input) => { From 7aee12bcd4a70cc51a0fd50228883fa76298cd50 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Wed, 5 Feb 2025 10:27:47 +0200 Subject: [PATCH 2/5] fix openEditStatusStore --- src/components/status_action_buttons/buttons_definitions.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/status_action_buttons/buttons_definitions.js b/src/components/status_action_buttons/buttons_definitions.js index 64a95ab85..b9dc522c4 100644 --- a/src/components/status_action_buttons/buttons_definitions.js +++ b/src/components/status_action_buttons/buttons_definitions.js @@ -1,3 +1,4 @@ +import { useEditStatusStore } from 'src/stores/editStatus.js' const PRIVATE_SCOPES = new Set(['private', 'direct']) const PUBLIC_SCOPES = new Set(['public', 'unlisted']) export const BUTTONS = [{ @@ -151,7 +152,7 @@ export const BUTTONS = [{ }, action ({ dispatch, status }) { return dispatch('fetchStatusSource', { id: status.id }) - .then(data => dispatch('openEditStatusModal', { + .then(data => useEditStatusStore().openEditStatusModal({ statusId: status.id, subject: data.spoiler_text, statusText: data.text, From f8fa540af794e7640c6583e9f91bbc8aaddd736f Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Mon, 10 Feb 2025 23:02:34 +0200 Subject: [PATCH 3/5] Revert "store cache eagerly" This reverts commit 21af30f71b9500781679c164a3b3b3b751928d34. --- src/services/style_setter/style_setter.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/services/style_setter/style_setter.js b/src/services/style_setter/style_setter.js index 63fb0a138..f04c9d10e 100644 --- a/src/services/style_setter/style_setter.js +++ b/src/services/style_setter/style_setter.js @@ -137,7 +137,6 @@ export const applyTheme = ( } } - let cache const { lazyProcessFunc } = generateTheme( input, { @@ -150,13 +149,16 @@ export const applyTheme = ( }, onEagerFinished () { adoptStyleSheets([eagerStyles]) - cache = { engineChecksum: getEngineChecksum(), data: [eagerStyles.rules, lazyStyles.rules] } - localforage.setItem('pleromafe-theme-cache', cache) onEagerFinish() }, onLazyFinished () { adoptStyleSheets([eagerStyles, lazyStyles]) + const cache = { engineChecksum: getEngineChecksum(), data: [eagerStyles.rules, lazyStyles.rules] } onFinish(cache) + const compress = (js) => { + return pako.deflate(JSON.stringify(js)) + } + localforage.setItem('pleromafe-theme-cache', compress(cache)) } }, debug From 2e78975e4c332f43a37e104d94efe114b92c62b5 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Mon, 10 Feb 2025 23:10:04 +0200 Subject: [PATCH 4/5] post-revert fix + logging --- src/services/style_setter/style_setter.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/services/style_setter/style_setter.js b/src/services/style_setter/style_setter.js index f04c9d10e..5eb810884 100644 --- a/src/services/style_setter/style_setter.js +++ b/src/services/style_setter/style_setter.js @@ -150,15 +150,14 @@ export const applyTheme = ( onEagerFinished () { adoptStyleSheets([eagerStyles]) onEagerFinish() + console.info('Eager part of theme finished, waiting for lazy part to finish to store cache') }, onLazyFinished () { adoptStyleSheets([eagerStyles, lazyStyles]) const cache = { engineChecksum: getEngineChecksum(), data: [eagerStyles.rules, lazyStyles.rules] } onFinish(cache) - const compress = (js) => { - return pako.deflate(JSON.stringify(js)) - } - localforage.setItem('pleromafe-theme-cache', compress(cache)) + localforage.setItem('pleromafe-theme-cache', cache) + console.info('Theme cache stored') } }, debug From da73226cb133bce3dde772fbd721f7be450638ec Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Mon, 10 Feb 2025 23:15:39 +0200 Subject: [PATCH 5/5] rename + fix --- .../mobile_post_status_button/mobile_post_status_button.js | 2 +- src/components/post_status_modal/post_status_modal.js | 2 +- src/components/user_card/user_card.js | 2 +- src/stores/{postStatus.js => post_status.js} | 3 +++ 4 files changed, 6 insertions(+), 3 deletions(-) rename src/stores/{postStatus.js => post_status.js} (85%) diff --git a/src/components/mobile_post_status_button/mobile_post_status_button.js b/src/components/mobile_post_status_button/mobile_post_status_button.js index ab4d761f4..031013559 100644 --- a/src/components/mobile_post_status_button/mobile_post_status_button.js +++ b/src/components/mobile_post_status_button/mobile_post_status_button.js @@ -3,7 +3,7 @@ import { library } from '@fortawesome/fontawesome-svg-core' import { faPen } from '@fortawesome/free-solid-svg-icons' -import { usePostStatusStore } from 'src/stores/postStatus' +import { usePostStatusStore } from 'src/stores/post_status' library.add( faPen diff --git a/src/components/post_status_modal/post_status_modal.js b/src/components/post_status_modal/post_status_modal.js index 5e7c1f515..ee6cd6444 100644 --- a/src/components/post_status_modal/post_status_modal.js +++ b/src/components/post_status_modal/post_status_modal.js @@ -1,7 +1,7 @@ import PostStatusForm from '../post_status_form/post_status_form.vue' import Modal from '../modal/modal.vue' import get from 'lodash/get' -import { usePostStatusStore } from 'src/stores/postStatus' +import { usePostStatusStore } from 'src/stores/post_status' const PostStatusModal = { components: { diff --git a/src/components/user_card/user_card.js b/src/components/user_card/user_card.js index c2ddf5d80..be81b8ad5 100644 --- a/src/components/user_card/user_card.js +++ b/src/components/user_card/user_card.js @@ -11,7 +11,7 @@ import RichContent from 'src/components/rich_content/rich_content.jsx' import MuteConfirm from '../confirm_modal/mute_confirm.vue' import generateProfileLink from 'src/services/user_profile_link_generator/user_profile_link_generator' import { mapGetters } from 'vuex' -import { usePostStatusStore } from 'src/stores/postStatus' +import { usePostStatusStore } from 'src/stores/post_status' import { library } from '@fortawesome/fontawesome-svg-core' import { faBell, diff --git a/src/stores/postStatus.js b/src/stores/post_status.js similarity index 85% rename from src/stores/postStatus.js rename to src/stores/post_status.js index b9fe96d3c..a19b0dbdd 100644 --- a/src/stores/postStatus.js +++ b/src/stores/post_status.js @@ -12,6 +12,9 @@ export const usePostStatusStore = defineStore('postStatus', { }, closePostStatusModal () { this.modalActivated = false + }, + resetPostStatusModal () { + this.params = null } } })