lint
This commit is contained in:
parent
bc97016ea3
commit
18a3bbbd49
15 changed files with 43 additions and 36 deletions
|
|
@ -187,7 +187,8 @@ const Attachment = {
|
||||||
if (
|
if (
|
||||||
this.mergedConfig.useOneClickNsfw &&
|
this.mergedConfig.useOneClickNsfw &&
|
||||||
!this.showHidden &&
|
!this.showHidden &&
|
||||||
(this.attachment.type !== 'video' || this.mergedConfig.playVideosInModal)
|
(this.attachment.type !== 'video' ||
|
||||||
|
this.mergedConfig.playVideosInModal)
|
||||||
) {
|
) {
|
||||||
this.openModal(event)
|
this.openModal(event)
|
||||||
return
|
return
|
||||||
|
|
|
||||||
|
|
@ -25,9 +25,7 @@ const ChatListItem = {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const types = this.chat.lastMessage.attachments.map((file) =>
|
const types = this.chat.lastMessage.attachments.map((file) => file.type)
|
||||||
file.type,
|
|
||||||
)
|
|
||||||
if (types.includes('video')) {
|
if (types.includes('video')) {
|
||||||
return this.$t('file_type.video')
|
return this.$t('file_type.video')
|
||||||
} else if (types.includes('audio')) {
|
} else if (types.includes('audio')) {
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import Checkbox from 'src/components/checkbox/checkbox.vue'
|
import Checkbox from 'src/components/checkbox/checkbox.vue'
|
||||||
import Popover from 'src/components/popover/popover.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 LocalSettingIndicator from 'src/components/settings_modal/helpers/local_setting_indicator.vue'
|
||||||
|
import Select from '../select/select.vue'
|
||||||
|
|
||||||
import { useInterfaceStore } from 'src/stores/interface.js'
|
import { useInterfaceStore } from 'src/stores/interface.js'
|
||||||
|
|
||||||
|
|
@ -21,7 +21,15 @@ export default {
|
||||||
Popover,
|
Popover,
|
||||||
LocalSettingIndicator,
|
LocalSettingIndicator,
|
||||||
},
|
},
|
||||||
props: ['name', 'label', 'modelValue', 'fallback', 'options', 'no-inherit', 'isLocal'],
|
props: [
|
||||||
|
'name',
|
||||||
|
'label',
|
||||||
|
'modelValue',
|
||||||
|
'fallback',
|
||||||
|
'options',
|
||||||
|
'no-inherit',
|
||||||
|
'isLocal',
|
||||||
|
],
|
||||||
mounted() {
|
mounted() {
|
||||||
useInterfaceStore().queryLocalFonts()
|
useInterfaceStore().queryLocalFonts()
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import Attachment from '../attachment/attachment.vue'
|
||||||
|
|
||||||
import { useMediaViewerStore } from 'src/stores/media_viewer.js'
|
import { useMediaViewerStore } from 'src/stores/media_viewer.js'
|
||||||
|
|
||||||
const displayTypes = new Set(["image", "video", "flash"])
|
const displayTypes = new Set(['image', 'video', 'flash'])
|
||||||
|
|
||||||
const Gallery = {
|
const Gallery = {
|
||||||
props: [
|
props: [
|
||||||
|
|
|
||||||
|
|
@ -124,11 +124,10 @@ const ListsNew = {
|
||||||
useListsStore()
|
useListsStore()
|
||||||
.createList({ title: this.titleDraft })
|
.createList({ title: this.titleDraft })
|
||||||
.then((list) => {
|
.then((list) => {
|
||||||
useListsStore()
|
useListsStore().setListAccounts({
|
||||||
.setListAccounts({
|
listId: list.id,
|
||||||
listId: list.id,
|
accountIds: [...this.addedUserIds],
|
||||||
accountIds: [...this.addedUserIds],
|
})
|
||||||
})
|
|
||||||
return list.id
|
return list.id
|
||||||
})
|
})
|
||||||
.then((listId) => {
|
.then((listId) => {
|
||||||
|
|
|
||||||
|
|
@ -183,7 +183,6 @@ const Notification = {
|
||||||
return highlightClass(this.notification.from_profile)
|
return highlightClass(this.notification.from_profile)
|
||||||
},
|
},
|
||||||
userStyle() {
|
userStyle() {
|
||||||
const highlight = useSyncConfigStore().mergedConfig.highlight
|
|
||||||
const user = this.notification.from_profile
|
const user = this.notification.from_profile
|
||||||
return highlightStyle(useUserHighlightStore().get(user))
|
return highlightStyle(useUserHighlightStore().get(user))
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,13 @@
|
||||||
import { cloneDeep, get, isEqual, set } from 'lodash'
|
import { cloneDeep, get, isEqual, set } from 'lodash'
|
||||||
|
|
||||||
import DraftButtons from './draft_buttons.vue'
|
import DraftButtons from './draft_buttons.vue'
|
||||||
import ModifiedIndicator from './modified_indicator.vue'
|
|
||||||
import LocalSettingIndicator from './local_setting_indicator.vue'
|
import LocalSettingIndicator from './local_setting_indicator.vue'
|
||||||
|
import ModifiedIndicator from './modified_indicator.vue'
|
||||||
|
|
||||||
import { useInstanceStore } from 'src/stores/instance.js'
|
import { useInstanceStore } from 'src/stores/instance.js'
|
||||||
import { useInterfaceStore } from 'src/stores/interface.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 { useLocalConfigStore } from 'src/stores/local_config.js'
|
||||||
|
import { useSyncConfigStore } from 'src/stores/sync_config.js'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
|
|
@ -300,7 +300,10 @@ export default {
|
||||||
|
|
||||||
const revert = () => {
|
const revert = () => {
|
||||||
if (this.local) {
|
if (this.local) {
|
||||||
useLocalConfigStore().unsetTemporarily({ path: writePath, value })
|
useLocalConfigStore().unsetTemporarily({
|
||||||
|
path: writePath,
|
||||||
|
value,
|
||||||
|
})
|
||||||
} else {
|
} else {
|
||||||
useSyncConfigStore().setPreference({
|
useSyncConfigStore().setPreference({
|
||||||
path: writePath,
|
path: writePath,
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ import UnitSetting from '../helpers/unit_setting.vue'
|
||||||
|
|
||||||
import { useInstanceStore } from 'src/stores/instance.js'
|
import { useInstanceStore } from 'src/stores/instance.js'
|
||||||
import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.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 { useSyncConfigStore } from 'src/stores/sync_config.js'
|
||||||
|
|
||||||
import localeService from 'src/services/locale/locale.service.js'
|
import localeService from 'src/services/locale/locale.service.js'
|
||||||
|
|
|
||||||
|
|
@ -103,9 +103,7 @@ const StatusBody = {
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
attachmentTypes() {
|
attachmentTypes() {
|
||||||
return this.status.attachments.map((file) =>
|
return this.status.attachments.map((file) => file.type)
|
||||||
file.type,
|
|
||||||
)
|
|
||||||
},
|
},
|
||||||
collapsedStatus() {
|
collapsedStatus() {
|
||||||
return this.status.raw_html.replace(/(\n|<br\s?\/?>)/g, ' ')
|
return this.status.raw_html.replace(/(\n|<br\s?\/?>)/g, ' ')
|
||||||
|
|
|
||||||
|
|
@ -227,14 +227,14 @@ export default {
|
||||||
}))
|
}))
|
||||||
},
|
},
|
||||||
userHighlightType: {
|
userHighlightType: {
|
||||||
get () {
|
get() {
|
||||||
return useUserHighlightStore().get(this.user.screen_name).type
|
return useUserHighlightStore().get(this.user.screen_name).type
|
||||||
},
|
},
|
||||||
set (type) {
|
set(type) {
|
||||||
if (type !== 'disabled') {
|
if (type !== 'disabled') {
|
||||||
useUserHighlightStore().setAndSave({
|
useUserHighlightStore().setAndSave({
|
||||||
user: this.user.screen_name,
|
user: this.user.screen_name,
|
||||||
value: { type }
|
value: { type },
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
useUserHighlightStore().unsetAndSave({ user: this.user.screen_name })
|
useUserHighlightStore().unsetAndSave({ user: this.user.screen_name })
|
||||||
|
|
@ -248,7 +248,7 @@ export default {
|
||||||
set(color) {
|
set(color) {
|
||||||
useUserHighlightStore().setAndSave({
|
useUserHighlightStore().setAndSave({
|
||||||
user: this.user.screen_name,
|
user: this.user.screen_name,
|
||||||
value: { color }
|
value: { color },
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
import { applyStyleConfig } from 'src/services/style_setter/style_setter.js'
|
|
||||||
import { useSyncConfigStore } from 'src/stores/sync_config.js'
|
import { useSyncConfigStore } from 'src/stores/sync_config.js'
|
||||||
|
|
||||||
|
import { applyStyleConfig } from 'src/services/style_setter/style_setter.js'
|
||||||
|
|
||||||
const ACTIONS = new Set([
|
const ACTIONS = new Set([
|
||||||
'setPreference',
|
'setPreference',
|
||||||
'unsetPreference',
|
'unsetPreference',
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
import { parseLinkHeader } from '@web3-storage/parse-link-header'
|
import { parseLinkHeader } from '@web3-storage/parse-link-header'
|
||||||
import escapeHtml from 'escape-html'
|
import escapeHtml from 'escape-html'
|
||||||
import fileTypeService from '../file_type/file_type.service.js'
|
|
||||||
import punycode from 'punycode.js'
|
import punycode from 'punycode.js'
|
||||||
|
|
||||||
|
import fileTypeService from '../file_type/file_type.service.js'
|
||||||
import { isStatusNotification } from '../notification_utils/notification_utils.js'
|
import { isStatusNotification } from '../notification_utils/notification_utils.js'
|
||||||
|
|
||||||
/** NOTICE! **
|
/** NOTICE! **
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,9 @@ export const getAttrs = (tag, filter) => {
|
||||||
.replace(/\/?$/, '')
|
.replace(/\/?$/, '')
|
||||||
.trim()
|
.trim()
|
||||||
const attrs = Array.from(
|
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(([, key, value]) => [key, value])
|
||||||
.map(([k, v]) => {
|
.map(([k, v]) => {
|
||||||
|
|
|
||||||
|
|
@ -11,8 +11,8 @@ export const defaultState = {
|
||||||
...configDefaultState,
|
...configDefaultState,
|
||||||
},
|
},
|
||||||
tempStorage: {
|
tempStorage: {
|
||||||
...configDefaultState
|
...configDefaultState,
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
export const useLocalConfigStore = defineStore('local_config', {
|
export const useLocalConfigStore = defineStore('local_config', {
|
||||||
|
|
|
||||||
|
|
@ -398,7 +398,11 @@ export const _resetPrefs = (
|
||||||
totalFlags.reset <= COMMAND_WIPE_JOURNAL_AND_STORAGE
|
totalFlags.reset <= COMMAND_WIPE_JOURNAL_AND_STORAGE
|
||||||
) {
|
) {
|
||||||
console.debug('Received command to reset journals')
|
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) {
|
if (totalFlags.reset === COMMAND_WIPE_JOURNAL_AND_STORAGE) {
|
||||||
console.debug('Received command to reset storage')
|
console.debug('Received command to reset storage')
|
||||||
return cloneDeep(defaultState)
|
return cloneDeep(defaultState)
|
||||||
|
|
@ -598,13 +602,6 @@ export const useSyncConfigStore = defineStore('sync_config', {
|
||||||
})
|
})
|
||||||
this.flagStorage.reset = COMMAND_WIPE_JOURNAL_AND_STORAGE
|
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) {
|
initSyncConfig(userData) {
|
||||||
console.log(userData)
|
console.log(userData)
|
||||||
const live = userData.storage
|
const live = userData.storage
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue