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/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, 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/services/style_setter/style_setter.js b/src/services/style_setter/style_setter.js index 4ebcba019..5eb810884 100644 --- a/src/services/style_setter/style_setter.js +++ b/src/services/style_setter/style_setter.js @@ -4,8 +4,6 @@ import { defaultState } from 'src/modules/default_config_state.js' import { chunk } from 'lodash' 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 @@ -139,7 +137,6 @@ export const applyTheme = ( } } - let cache const { lazyProcessFunc } = generateTheme( input, { @@ -152,13 +149,15 @@ export const applyTheme = ( }, onEagerFinished () { adoptStyleSheets([eagerStyles]) - cache = { engineChecksum: getEngineChecksum(), data: [eagerStyles.rules, lazyStyles.rules] } - localforage.setItem('pleromafe-theme-cache', cache) 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) + localforage.setItem('pleromafe-theme-cache', cache) + console.info('Theme cache stored') } }, debug @@ -207,7 +206,6 @@ const extractStyleConfig = ({ return result } -console.log(defaultState) const defaultStyleConfig = extractStyleConfig(defaultState) export const applyConfig = (input) => { 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 } } })