This commit is contained in:
Henry Jameson 2026-03-06 15:25:30 +02:00
commit 18a3bbbd49
15 changed files with 43 additions and 36 deletions

View file

@ -187,7 +187,8 @@ 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

View file

@ -25,9 +25,7 @@ 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')) {

View file

@ -1,7 +1,7 @@
import Checkbox from 'src/components/checkbox/checkbox.vue'
import Popover from 'src/components/popover/popover.vue'
import Select from '../select/select.vue'
import LocalSettingIndicator from 'src/components/settings_modal/helpers/local_setting_indicator.vue'
import Select from '../select/select.vue'
import { useInterfaceStore } from 'src/stores/interface.js'
@ -21,7 +21,15 @@ 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()
},

View file

@ -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: [

View file

@ -124,11 +124,10 @@ 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) => {

View file

@ -183,7 +183,6 @@ 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))
},

View file

@ -1,13 +1,13 @@
import { cloneDeep, get, isEqual, set } from 'lodash'
import DraftButtons from './draft_buttons.vue'
import ModifiedIndicator from './modified_indicator.vue'
import LocalSettingIndicator from './local_setting_indicator.vue'
import ModifiedIndicator from './modified_indicator.vue'
import { useInstanceStore } from 'src/stores/instance.js'
import { useInterfaceStore } from 'src/stores/interface.js'
import { useSyncConfigStore } from 'src/stores/sync_config.js'
import { useLocalConfigStore } from 'src/stores/local_config.js'
import { useSyncConfigStore } from 'src/stores/sync_config.js'
export default {
components: {
@ -300,7 +300,10 @@ export default {
const revert = () => {
if (this.local) {
useLocalConfigStore().unsetTemporarily({ path: writePath, value })
useLocalConfigStore().unsetTemporarily({
path: writePath,
value,
})
} else {
useSyncConfigStore().setPreference({
path: writePath,

View file

@ -10,6 +10,7 @@ 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'

View file

@ -103,9 +103,7 @@ 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|<br\s?\/?>)/g, ' ')

View file

@ -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 },
})
},
},

View file

@ -1,6 +1,7 @@
import { applyStyleConfig } from 'src/services/style_setter/style_setter.js'
import { useSyncConfigStore } from 'src/stores/sync_config.js'
import { applyStyleConfig } from 'src/services/style_setter/style_setter.js'
const ACTIONS = new Set([
'setPreference',
'unsetPreference',

View file

@ -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! **

View file

@ -23,7 +23,9 @@ 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]) => {

View file

@ -11,8 +11,8 @@ export const defaultState = {
...configDefaultState,
},
tempStorage: {
...configDefaultState
}
...configDefaultState,
},
}
export const useLocalConfigStore = defineStore('local_config', {

View file

@ -398,7 +398,11 @@ export const _resetPrefs = (
totalFlags.reset <= COMMAND_WIPE_JOURNAL_AND_STORAGE
) {
console.debug('Received command to reset journals')
clearJournals()
this.flagStorage.reset = COMMAND_WIPE_JOURNAL
this.prefsStorage._journal = []
this.cache.prefsStorage._journal = []
this.raw.prefsStorage._journal = []
this.pushSyncConfig()
if (totalFlags.reset === COMMAND_WIPE_JOURNAL_AND_STORAGE) {
console.debug('Received command to reset storage')
return cloneDeep(defaultState)
@ -598,13 +602,6 @@ 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