diff --git a/src/components/attachment/attachment.js b/src/components/attachment/attachment.js index 32d8426b8..2fb8064d9 100644 --- a/src/components/attachment/attachment.js +++ b/src/components/attachment/attachment.js @@ -187,8 +187,7 @@ const Attachment = { if ( this.mergedConfig.useOneClickNsfw && !this.showHidden && - (this.attachment.type !== 'video' || - this.mergedConfig.playVideosInModal) + (this.attachment.type !== 'video' || this.mergedConfig.playVideosInModal) ) { this.openModal(event) return diff --git a/src/components/chat_list_item/chat_list_item.js b/src/components/chat_list_item/chat_list_item.js index 74df26c1f..202455c53 100644 --- a/src/components/chat_list_item/chat_list_item.js +++ b/src/components/chat_list_item/chat_list_item.js @@ -25,7 +25,9 @@ const ChatListItem = { return } - const types = this.chat.lastMessage.attachments.map((file) => file.type) + const types = this.chat.lastMessage.attachments.map((file) => + file.type, + ) if (types.includes('video')) { return this.$t('file_type.video') } else if (types.includes('audio')) { diff --git a/src/components/font_control/font_control.js b/src/components/font_control/font_control.js index db55319ce..c52c31bfe 100644 --- a/src/components/font_control/font_control.js +++ b/src/components/font_control/font_control.js @@ -1,7 +1,7 @@ import Checkbox from 'src/components/checkbox/checkbox.vue' import Popover from 'src/components/popover/popover.vue' -import LocalSettingIndicator from 'src/components/settings_modal/helpers/local_setting_indicator.vue' import Select from '../select/select.vue' +import LocalSettingIndicator from 'src/components/settings_modal/helpers/local_setting_indicator.vue' import { useInterfaceStore } from 'src/stores/interface.js' @@ -21,15 +21,7 @@ export default { Popover, LocalSettingIndicator, }, - props: [ - 'name', - 'label', - 'modelValue', - 'fallback', - 'options', - 'no-inherit', - 'isLocal', - ], + props: ['name', 'label', 'modelValue', 'fallback', 'options', 'no-inherit', 'isLocal'], mounted() { useInterfaceStore().queryLocalFonts() }, diff --git a/src/components/gallery/gallery.js b/src/components/gallery/gallery.js index fafb66dbd..42cc6cfd6 100644 --- a/src/components/gallery/gallery.js +++ b/src/components/gallery/gallery.js @@ -4,7 +4,7 @@ import Attachment from '../attachment/attachment.vue' import { useMediaViewerStore } from 'src/stores/media_viewer.js' -const displayTypes = new Set(['image', 'video', 'flash']) +const displayTypes = new Set(["image", "video", "flash"]) const Gallery = { props: [ diff --git a/src/components/lists_edit/lists_edit.js b/src/components/lists_edit/lists_edit.js index 483a9c02a..bdadd4fca 100644 --- a/src/components/lists_edit/lists_edit.js +++ b/src/components/lists_edit/lists_edit.js @@ -124,10 +124,11 @@ const ListsNew = { useListsStore() .createList({ title: this.titleDraft }) .then((list) => { - useListsStore().setListAccounts({ - listId: list.id, - accountIds: [...this.addedUserIds], - }) + useListsStore() + .setListAccounts({ + listId: list.id, + accountIds: [...this.addedUserIds], + }) return list.id }) .then((listId) => { diff --git a/src/components/notification/notification.js b/src/components/notification/notification.js index f5a680023..b6ebc4364 100644 --- a/src/components/notification/notification.js +++ b/src/components/notification/notification.js @@ -183,6 +183,7 @@ const Notification = { return highlightClass(this.notification.from_profile) }, userStyle() { + const highlight = useSyncConfigStore().mergedConfig.highlight const user = this.notification.from_profile return highlightStyle(useUserHighlightStore().get(user)) }, diff --git a/src/components/settings_modal/helpers/setting.js b/src/components/settings_modal/helpers/setting.js index fc5f89175..4bbf2a612 100644 --- a/src/components/settings_modal/helpers/setting.js +++ b/src/components/settings_modal/helpers/setting.js @@ -1,13 +1,13 @@ import { cloneDeep, get, isEqual, set } from 'lodash' import DraftButtons from './draft_buttons.vue' -import LocalSettingIndicator from './local_setting_indicator.vue' import ModifiedIndicator from './modified_indicator.vue' +import LocalSettingIndicator from './local_setting_indicator.vue' import { useInstanceStore } from 'src/stores/instance.js' import { useInterfaceStore } from 'src/stores/interface.js' -import { useLocalConfigStore } from 'src/stores/local_config.js' import { useSyncConfigStore } from 'src/stores/sync_config.js' +import { useLocalConfigStore } from 'src/stores/local_config.js' export default { components: { @@ -300,10 +300,7 @@ export default { const revert = () => { if (this.local) { - useLocalConfigStore().unsetTemporarily({ - path: writePath, - value, - }) + useLocalConfigStore().unsetTemporarily({ path: writePath, value }) } else { useSyncConfigStore().setPreference({ path: writePath, diff --git a/src/components/settings_modal/tabs/general_tab.js b/src/components/settings_modal/tabs/general_tab.js index b0eac97c0..d67bc948d 100644 --- a/src/components/settings_modal/tabs/general_tab.js +++ b/src/components/settings_modal/tabs/general_tab.js @@ -10,7 +10,6 @@ import UnitSetting from '../helpers/unit_setting.vue' import { useInstanceStore } from 'src/stores/instance.js' import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js' -import { useLocalConfigStore } from 'src/stores/local_config.js' import { useSyncConfigStore } from 'src/stores/sync_config.js' import localeService from 'src/services/locale/locale.service.js' diff --git a/src/components/status_body/status_body.js b/src/components/status_body/status_body.js index 06adcfea8..ecc59719c 100644 --- a/src/components/status_body/status_body.js +++ b/src/components/status_body/status_body.js @@ -103,7 +103,9 @@ const StatusBody = { ) }, attachmentTypes() { - return this.status.attachments.map((file) => file.type) + return this.status.attachments.map((file) => + file.type, + ) }, collapsedStatus() { return this.status.raw_html.replace(/(\n|)/g, ' ') diff --git a/src/components/user_card/user_card.js b/src/components/user_card/user_card.js index ce667d0c2..491238937 100644 --- a/src/components/user_card/user_card.js +++ b/src/components/user_card/user_card.js @@ -227,14 +227,14 @@ export default { })) }, userHighlightType: { - get() { + get () { return useUserHighlightStore().get(this.user.screen_name).type }, - set(type) { + set (type) { if (type !== 'disabled') { useUserHighlightStore().setAndSave({ user: this.user.screen_name, - value: { type }, + value: { type } }) } else { useUserHighlightStore().unsetAndSave({ user: this.user.screen_name }) @@ -248,7 +248,7 @@ export default { set(color) { useUserHighlightStore().setAndSave({ user: this.user.screen_name, - value: { color }, + value: { color } }) }, }, diff --git a/src/lib/style.js b/src/lib/style.js index 50120b37b..3b2d9dad4 100644 --- a/src/lib/style.js +++ b/src/lib/style.js @@ -1,6 +1,5 @@ -import { useSyncConfigStore } from 'src/stores/sync_config.js' - import { applyStyleConfig } from 'src/services/style_setter/style_setter.js' +import { useSyncConfigStore } from 'src/stores/sync_config.js' const ACTIONS = new Set([ 'setPreference', diff --git a/src/services/entity_normalizer/entity_normalizer.service.js b/src/services/entity_normalizer/entity_normalizer.service.js index 3f1b3e253..0135d1651 100644 --- a/src/services/entity_normalizer/entity_normalizer.service.js +++ b/src/services/entity_normalizer/entity_normalizer.service.js @@ -1,8 +1,8 @@ import { parseLinkHeader } from '@web3-storage/parse-link-header' import escapeHtml from 'escape-html' +import fileTypeService from '../file_type/file_type.service.js' import punycode from 'punycode.js' -import fileTypeService from '../file_type/file_type.service.js' import { isStatusNotification } from '../notification_utils/notification_utils.js' /** NOTICE! ** diff --git a/src/services/html_converter/utility.service.js b/src/services/html_converter/utility.service.js index 684f96ca1..4c36eda2f 100644 --- a/src/services/html_converter/utility.service.js +++ b/src/services/html_converter/utility.service.js @@ -23,9 +23,7 @@ export const getAttrs = (tag, filter) => { .replace(/\/?$/, '') .trim() const attrs = Array.from( - innertag.matchAll( - /([a-z]+[a-z0-9-]*)(?:=((?:"(?:\\.|[^"\\])*")|(?:'(?:\\.|[^'\\])*')))?/gi, - ), + innertag.matchAll(/([a-z]+[a-z0-9-]*)(?:=((?:"(?:\\.|[^"\\])*")|(?:'(?:\\.|[^'\\])*')))?/gi), ) .map(([, key, value]) => [key, value]) .map(([k, v]) => { diff --git a/src/stores/local_config.js b/src/stores/local_config.js index 117be393d..60d02f717 100644 --- a/src/stores/local_config.js +++ b/src/stores/local_config.js @@ -11,8 +11,8 @@ export const defaultState = { ...configDefaultState, }, tempStorage: { - ...configDefaultState, - }, + ...configDefaultState + } } export const useLocalConfigStore = defineStore('local_config', { diff --git a/src/stores/sync_config.js b/src/stores/sync_config.js index d0915e8aa..057fb86ea 100644 --- a/src/stores/sync_config.js +++ b/src/stores/sync_config.js @@ -398,11 +398,7 @@ export const _resetPrefs = ( totalFlags.reset <= COMMAND_WIPE_JOURNAL_AND_STORAGE ) { console.debug('Received command to reset journals') - this.flagStorage.reset = COMMAND_WIPE_JOURNAL - this.prefsStorage._journal = [] - this.cache.prefsStorage._journal = [] - this.raw.prefsStorage._journal = [] - this.pushSyncConfig() + clearJournals() if (totalFlags.reset === COMMAND_WIPE_JOURNAL_AND_STORAGE) { console.debug('Received command to reset storage') return cloneDeep(defaultState) @@ -602,6 +598,13 @@ export const useSyncConfigStore = defineStore('sync_config', { }) this.flagStorage.reset = COMMAND_WIPE_JOURNAL_AND_STORAGE }, + clearJournals() { + this.flagStorage.reset = COMMAND_WIPE_JOURNAL + this.prefsStorage._journal = [] + this.cache.prefsStorage._journal = [] + this.raw.prefsStorage._journal = [] + this.pushSyncConfig() + }, initSyncConfig(userData) { console.log(userData) const live = userData.storage