Merge branch 'renovate/major-eslint-monorepo' into 'develop'

Update dependency eslint to v9

See merge request pleroma/pleroma-fe!2031
This commit is contained in:
HJ 2025-02-04 13:52:31 +00:00
commit f659c9c123
110 changed files with 427 additions and 363 deletions

View file

@ -1,2 +0,0 @@
build/*.js
config/*.js

View file

@ -1,27 +0,0 @@
module.exports = {
root: true,
parserOptions: {
parser: '@babel/eslint-parser',
sourceType: 'module'
},
// https://github.com/feross/standard/blob/master/RULES.md#javascript-standard-style
extends: [
'standard',
'plugin:vue/recommended'
],
// required to lint *.vue files
plugins: [
'vue'
],
// add your custom rules here
rules: {
// allow paren-less arrow functions
'arrow-parens': 0,
// allow async-await
'generator-star-spacing': 0,
// allow debugger during development
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
'vue/require-prop-types': 0,
'vue/multi-word-component-names': 0
}
}

View file

@ -34,26 +34,18 @@ exports.cssLoaders = function (options) {
use: generateLoaders(['css-loader', 'postcss-loader', 'less-loader']), use: generateLoaders(['css-loader', 'postcss-loader', 'less-loader']),
}, },
{ {
test: /\.sass$/, test: /\.scss$/,
use: generateLoaders([ use: generateLoaders([
'css-loader', 'css-loader',
'postcss-loader', 'postcss-loader',
{ {
loader: 'sass-loader', loader: 'sass-loader',
options: { options: {
indentedSyntax: true api: 'modern'
} }
} }
]) ])
}, }
{
test: /\.scss$/,
use: generateLoaders(['css-loader', 'postcss-loader', 'sass-loader'])
},
{
test: /\.styl(us)?$/,
use: generateLoaders(['css-loader', 'postcss-loader', 'stylus-loader']),
},
] ]
} }

View file

@ -108,8 +108,9 @@ module.exports = {
filename: 'sw-pleroma.js' filename: 'sw-pleroma.js'
}), }),
new ESLintPlugin({ new ESLintPlugin({
extensions: ['js', 'vue'], formatter: require('eslint-formatter-friendly'),
formatter: require('eslint-formatter-friendly') overrideConfigFile: path.resolve(__dirname, '..', 'eslint.config.mjs'),
configType: 'flat'
}), }),
new StylelintPlugin({}), new StylelintPlugin({}),
new VueLoaderPlugin(), new VueLoaderPlugin(),

37
eslint.config.mjs Normal file
View file

@ -0,0 +1,37 @@
import vue from "eslint-plugin-vue";
import js from "@eslint/js";
import globals from "globals";
export default [
...vue.configs['flat/recommended'],
js.configs.recommended,
{
files: ["**/*.js", "**/*.mjs", "**/*.vue"],
ignores: ["build/*.js", "config/*.js"],
languageOptions: {
ecmaVersion: 2024,
sourceType: "module",
parserOptions: {
parser: "@babel/eslint-parser",
},
globals: {
...globals.browser,
...globals.mocha,
...globals.chai,
...globals.commonjs,
...globals.serviceworker
}
},
rules: {
'arrow-parens': 0,
'generator-star-spacing': 0,
'no-debugger': 0,
'vue/require-prop-types': 0,
'vue/multi-word-component-names': 0,
}
}
]

View file

@ -12,8 +12,8 @@
"e2e": "node test/e2e/runner.js", "e2e": "node test/e2e/runner.js",
"test": "yarn run unit && yarn run e2e", "test": "yarn run unit && yarn run e2e",
"stylelint": "yarn exec stylelint '**/*.scss' '**/*.vue'", "stylelint": "yarn exec stylelint '**/*.scss' '**/*.vue'",
"lint": "eslint --ext .js,.vue src test/unit/specs test/e2e/specs", "lint": "eslint src test/unit/specs test/e2e/specs",
"lint-fix": "eslint --fix --ext .js,.vue src test/unit/specs test/e2e/specs" "lint-fix": "eslint --fix src test/unit/specs test/e2e/specs"
}, },
"dependencies": { "dependencies": {
"@babel/runtime": "7.26.7", "@babel/runtime": "7.26.7",
@ -32,6 +32,7 @@
"click-outside-vue3": "4.0.1", "click-outside-vue3": "4.0.1",
"cropperjs": "1.6.2", "cropperjs": "1.6.2",
"escape-html": "1.0.3", "escape-html": "1.0.3",
"globals": "^15.14.0",
"hash-sum": "^2.0.0", "hash-sum": "^2.0.0",
"js-cookie": "3.0.5", "js-cookie": "3.0.5",
"localforage": "1.10.0", "localforage": "1.10.0",
@ -74,14 +75,14 @@
"css-loader": "7.1.2", "css-loader": "7.1.2",
"css-minimizer-webpack-plugin": "7.0.0", "css-minimizer-webpack-plugin": "7.0.0",
"custom-event-polyfill": "1.0.7", "custom-event-polyfill": "1.0.7",
"eslint": "8.57.1", "eslint": "9.19.0",
"eslint-config-standard": "17.1.0", "eslint-config-standard": "17.1.0",
"eslint-formatter-friendly": "7.0.0", "eslint-formatter-friendly": "7.0.0",
"eslint-plugin-import": "2.31.0", "eslint-plugin-import": "2.31.0",
"eslint-plugin-n": "15.7.0", "eslint-plugin-n": "15.7.0",
"eslint-plugin-promise": "6.6.0", "eslint-plugin-promise": "6.6.0",
"eslint-plugin-vue": "9.32.0", "eslint-plugin-vue": "9.32.0",
"eslint-webpack-plugin": "3.2.0", "eslint-webpack-plugin": "4.2.0",
"eventsource-polyfill": "0.9.6", "eventsource-polyfill": "0.9.6",
"express": "4.21.2", "express": "4.21.2",
"function-bind": "1.1.2", "function-bind": "1.1.2",

View file

@ -47,10 +47,10 @@ export default {
mobileActivePanel: 'timeline' mobileActivePanel: 'timeline'
}), }),
watch: { watch: {
themeApplied (value) { themeApplied () {
this.removeSplash() this.removeSplash()
}, },
layoutType (value) { layoutType () {
document.getElementById('modal').classList = ['-' + this.layoutType] document.getElementById('modal').classList = ['-' + this.layoutType]
} }
}, },

View file

@ -79,7 +79,7 @@ const getInstanceConfig = async ({ store }) => {
} }
} }
const getBackendProvidedConfig = async ({ store }) => { const getBackendProvidedConfig = async () => {
try { try {
const res = await window.fetch('/api/pleroma/frontend_configurations') const res = await window.fetch('/api/pleroma/frontend_configurations')
if (res.ok) { if (res.ok) {

View file

@ -43,7 +43,7 @@ export default (store) => {
{ {
name: 'root', name: 'root',
path: '/', path: '/',
redirect: _to => { redirect: () => {
return (store.state.users.currentUser return (store.state.users.currentUser
? store.state.instance.redirectRootLogin ? store.state.instance.redirectRootLogin
: store.state.instance.redirectRootNoLogin) || '/main/all' : store.state.instance.redirectRootNoLogin) || '/main/all'

View file

@ -145,7 +145,7 @@ const Attachment = {
window.open(target.href, '_blank') window.open(target.href, '_blank')
} }
}, },
openModal (event) { openModal () {
if (this.useModal) { if (this.useModal) {
this.$emit('setMedia') this.$emit('setMedia')
useMediaViewerStore().setCurrentMedia(this.attachment) useMediaViewerStore().setCurrentMedia(this.attachment)
@ -153,7 +153,7 @@ const Attachment = {
window.open(this.attachment.url) window.open(this.attachment.url)
} }
}, },
openModalForce (event) { openModalForce () {
this.$emit('setMedia') this.$emit('setMedia')
useMediaViewerStore().setCurrentMedia(this.attachment) useMediaViewerStore().setCurrentMedia(this.attachment)
}, },

View file

@ -238,8 +238,8 @@
ref="flash" ref="flash"
class="flash" class="flash"
:src="attachment.large_thumb_url || attachment.url" :src="attachment.large_thumb_url || attachment.url"
@playerOpened="setFlashLoaded(true)" @player-opened="setFlashLoaded(true)"
@playerClosed="setFlashLoaded(false)" @player-closed="setFlashLoaded(false)"
/> />
</span> </span>
</div> </div>

View file

@ -52,7 +52,7 @@ const ChatListItem = {
} }
}, },
methods: { methods: {
openChat (_e) { openChat () {
if (this.chat.id) { if (this.chat.id) {
this.$router.push({ this.$router.push({
name: 'chat', name: 'chat',

View file

@ -53,7 +53,7 @@ export default {
} }
}, },
methods: { methods: {
onTransitionEnd (e) { onTransitionEnd () {
if (!this.indeterminate) { if (!this.indeterminate) {
this.indeterminateTransitionFix = false this.indeterminateTransitionFix = false
} }

View file

@ -15,7 +15,7 @@
:model-value="present" :model-value="present"
:disabled="disabled" :disabled="disabled"
class="opt" class="opt"
@update:modelValue="updateValue(typeof modelValue === 'undefined' ? fallback : undefined)" @update:model-value="updateValue(typeof modelValue === 'undefined' ? fallback : undefined)"
/> />
<div <div
class="input color-input-field" class="input color-input-field"

View file

@ -114,7 +114,7 @@ const conversation = {
suspendable () { suspendable () {
if (this.isTreeView) { if (this.isTreeView) {
return Object.entries(this.statusContentProperties) return Object.entries(this.statusContentProperties)
.every(([k, prop]) => !prop.replying && prop.mediaPlaying.length === 0) .every(([, prop]) => !prop.replying && prop.mediaPlaying.length === 0)
} }
if (this.$refs.statusComponent && this.$refs.statusComponent[0]) { if (this.$refs.statusComponent && this.$refs.statusComponent[0]) {
return this.$refs.statusComponent.every(s => s.suspendable) return this.$refs.statusComponent.every(s => s.suspendable)
@ -272,11 +272,8 @@ const conversation = {
}, },
replies () { replies () {
let i = 1 let i = 1
// eslint-disable-next-line camelcase
return reduce(this.conversation, (result, { id, in_reply_to_status_id }) => { return reduce(this.conversation, (result, { id, in_reply_to_status_id: irid }) => {
/* eslint-disable camelcase */
const irid = in_reply_to_status_id
/* eslint-enable camelcase */
if (irid) { if (irid) {
result[irid] = result[irid] || [] result[irid] = result[irid] || []
result[irid].push({ result[irid].push({
@ -381,7 +378,7 @@ const conversation = {
this.resetDisplayState() this.resetDisplayState()
} }
}, },
virtualHidden (value) { virtualHidden () {
this.$store.dispatch( this.$store.dispatch(
'setVirtualHeight', 'setVirtualHeight',
{ statusId: this.statusId, height: `${this.$el.clientHeight}px` } { statusId: this.statusId, height: `${this.$el.clientHeight}px` }
@ -477,7 +474,7 @@ const conversation = {
// nothing found, fall back to toplevel // nothing found, fall back to toplevel
return this.topLevel[0] ? this.topLevel[0].id : undefined return this.topLevel[0] ? this.topLevel[0].id : undefined
}, },
diveIntoStatus (id, preventScroll) { diveIntoStatus (id) {
this.tryScrollTo(id) this.tryScrollTo(id)
}, },
diveToTopLevel () { diveToTopLevel () {

View file

@ -123,7 +123,7 @@
:controlled-set-media-playing="(newVal) => toggleStatusContentProperty(status.id, 'mediaPlaying', newVal)" :controlled-set-media-playing="(newVal) => toggleStatusContentProperty(status.id, 'mediaPlaying', newVal)"
@goto="setHighlight" @goto="setHighlight"
@toggleExpanded="toggleExpanded" @toggle-expanded="toggleExpanded"
/> />
<div <div
v-if="showOtherRepliesButtonBelowStatus && getReplies(status.id).length > 1" v-if="showOtherRepliesButtonBelowStatus && getReplies(status.id).length > 1"
@ -217,7 +217,7 @@
:toggle-status-content-property="toggleStatusContentProperty" :toggle-status-content-property="toggleStatusContentProperty"
@goto="setHighlight" @goto="setHighlight"
@toggleExpanded="toggleExpanded" @toggle-expanded="toggleExpanded"
/> />
</article> </article>
</div> </div>

View file

@ -2,7 +2,7 @@
<Modal <Modal
v-if="isFormVisible" v-if="isFormVisible"
class="edit-form-modal-view" class="edit-form-modal-view"
@backdropClicked="closeModal" @backdrop-clicked="closeModal"
> >
<div class="edit-form-modal-panel panel"> <div class="edit-form-modal-panel panel">
<div class="panel-heading"> <div class="panel-heading">

View file

@ -265,7 +265,7 @@ const EmojiInput = {
} }
}, },
watch: { watch: {
showSuggestions: function (newValue, oldValue) { showSuggestions: function (newValue) {
this.$emit('shown', newValue) this.$emit('shown', newValue)
if (newValue) { if (newValue) {
this.$refs.suggestorPopover.showPopover() this.$refs.suggestorPopover.showPopover()

View file

@ -116,7 +116,6 @@ export const suggestUsers = ({ dispatch, state }) => {
const screenNameAlphabetically = a.screen_name > b.screen_name ? 1 : -1 const screenNameAlphabetically = a.screen_name > b.screen_name ? 1 : -1
return diff + nameAlphabetically + screenNameAlphabetically return diff + nameAlphabetically + screenNameAlphabetically
/* eslint-disable camelcase */
}).map((user) => ({ }).map((user) => ({
user, user,
displayText: user.screen_name_ui, displayText: user.screen_name_ui,
@ -124,7 +123,6 @@ export const suggestUsers = ({ dispatch, state }) => {
imageUrl: user.profile_image_url_original, imageUrl: user.profile_image_url_original,
replacement: '@' + user.screen_name + ' ' replacement: '@' + user.screen_name + ' '
})) }))
/* eslint-enable camelcase */
suggestions = newSuggestions || [] suggestions = newSuggestions || []
return suggestions return suggestions

View file

@ -352,7 +352,7 @@ const EmojiPicker = {
}, },
allEmojiGroups () { allEmojiGroups () {
return Object.entries(this.allCustomGroups) return Object.entries(this.allCustomGroups)
.map(([_, v]) => v) .map(([, v]) => v)
.concat(this.unicodeEmojiGroups) .concat(this.unicodeEmojiGroups)
}, },
stickerPickerEnabled () { stickerPickerEnabled () {

View file

@ -71,7 +71,7 @@ const EmojiReactions = {
unreact (emoji) { unreact (emoji) {
this.$store.dispatch('unreactWithEmoji', { id: this.status.id, emoji }) this.$store.dispatch('unreactWithEmoji', { id: this.status.id, emoji })
}, },
async emojiOnClick (emoji, event) { async emojiOnClick (emoji) {
if (!this.loggedIn) return if (!this.loggedIn) return
await this.fetchEmojiReactionsByIfMissing() await this.fetchEmojiReactionsByIfMissing()

View file

@ -86,7 +86,7 @@
:id="name + '-local-font-switcher'" :id="name + '-local-font-switcher'"
:model-value="modelValue?.family" :model-value="modelValue?.family"
class="custom-font" class="custom-font"
@update:modelValue="v => $emit('update:modelValue', { ...(modelValue || {}), family: v })" @update:model-value="v => $emit('update:modelValue', { ...(modelValue || {}), family: v })"
> >
<optgroup <optgroup
:label="$t('settings.style.themes3.font.group-builtin')" :label="$t('settings.style.themes3.font.group-builtin')"

View file

@ -32,8 +32,8 @@
:description="descriptions && descriptions[attachment.id]" :description="descriptions && descriptions[attachment.id]"
:hide-description="size === 'small' || tooManyAttachments && hidingLong" :hide-description="size === 'small' || tooManyAttachments && hidingLong"
:style="itemStyle(attachment.id, row.items)" :style="itemStyle(attachment.id, row.items)"
@setMedia="onMedia" @set-media="onMedia"
@naturalSizeLoad="onNaturalSizeLoad" @natural-size-load="onNaturalSizeLoad"
/> />
</div> </div>
</div> </div>

View file

@ -13,7 +13,7 @@
<Select <Select
class="language-select" class="language-select"
:model-value="controlledLanguage[index]" :model-value="controlledLanguage[index]"
@update:modelValue="val => setLanguageAt(index, val)" @update:model-value="val => setLanguageAt(index, val)"
> >
<option <option
v-for="lang in languages" v-for="lang in languages"

View file

@ -37,7 +37,7 @@ export default {
}, },
getClass: { getClass: {
type: Function, type: Function,
default: item => '' default: () => ''
}, },
nonInteractive: { nonInteractive: {
type: Boolean, type: Boolean,

View file

@ -104,10 +104,10 @@ const ListsNew = {
removeUser (userId) { removeUser (userId) {
useListsStore().removeListAccount({ accountId: userId, listId: this.id }) useListsStore().removeListAccount({ accountId: userId, listId: this.id })
}, },
onSearchLoading (results) { onSearchLoading () {
this.searchLoading = true this.searchLoading = true
}, },
onSearchLoadingDone (results) { onSearchLoadingDone () {
this.searchLoading = false this.searchLoading = false
}, },
onSearchResults (results) { onSearchResults (results) {

View file

@ -84,7 +84,7 @@
<ListsUserSearch <ListsUserSearch
@results="onSearchResults" @results="onSearchResults"
@loading="onSearchLoading" @loading="onSearchLoading"
@loadingDone="onSearchLoadingDone" @loading-done="onSearchLoadingDone"
/> />
<div <div
v-if="searchLoading" v-if="searchLoading"

View file

@ -2,7 +2,7 @@
<Modal <Modal
v-if="showing" v-if="showing"
class="media-modal-view" class="media-modal-view"
@backdropClicked="hideIfNotSwiped" @backdrop-clicked="hideIfNotSwiped"
> >
<SwipeClick <SwipeClick
v-if="type === 'image'" v-if="type === 'image'"

View file

@ -96,12 +96,14 @@ const MentionLink = {
}, },
style () { style () {
if (this.highlight) { if (this.highlight) {
/* eslint-disable no-unused-vars */
const { const {
backgroundColor, backgroundColor,
backgroundPosition, backgroundPosition,
backgroundImage, backgroundImage,
...rest ...rest
} = highlightStyle(this.highlight) } = highlightStyle(this.highlight)
/* eslint-enable no-unused-vars */
return rest return rest
} }
}, },

View file

@ -25,6 +25,7 @@ export default {
default: false default: false
} }
}, },
emits: ['backdropClicked'],
computed: { computed: {
classes () { classes () {
return { return {

View file

@ -100,7 +100,7 @@ const ModerationTools = {
const user = this.user const user = this.user
const { id, name } = user const { id, name } = user
store.state.api.backendInteractor.deleteUser({ user }) store.state.api.backendInteractor.deleteUser({ user })
.then(e => { .then(() => {
this.$store.dispatch('markStatusesAsDeleted', status => user.id === status.user.id) this.$store.dispatch('markStatusesAsDeleted', status => user.id === status.user.id)
const isProfile = this.$route.name === 'external-user-profile' || this.$route.name === 'user-profile' const isProfile = this.$route.name === 'external-user-profile' || this.$route.name === 'user-profile'
const isTargetUser = this.$route.params.name === name || this.$route.params.id === id const isTargetUser = this.$route.params.name === name || this.$route.params.id === id

View file

@ -15,7 +15,7 @@
:model-value="present" :model-value="present"
:disabled="disabled" :disabled="disabled"
class="opt" class="opt"
@update:modelValue="$emit('update:modelValue', !present ? fallback : undefined)" @update:model-value="$emit('update:modelValue', !present ? fallback : undefined)"
/> />
<input <input
:id="name" :id="name"

View file

@ -10,7 +10,7 @@
:model-value="props.modelValue[key]" :model-value="props.modelValue[key]"
:fallback="fallback(key)" :fallback="fallback(key)"
:label="$t('settings.style.themes3.palette.' + key)" :label="$t('settings.style.themes3.palette.' + key)"
@update:modelValue="value => updatePalette(key, value)" @update:model-value="value => updatePalette(key, value)"
/> />
<button <button
class="btn button-default palette-import-button" class="btn button-default palette-import-button"
@ -87,7 +87,7 @@ const paletteExporter = newExporter({
}) })
const paletteImporter = newImporter({ const paletteImporter = newImporter({
accept: '.json', accept: '.json',
onImport (parsed, filename) { onImport (parsed) {
emit('update:modelValue', parsed) emit('update:modelValue', parsed)
} }
}) })
@ -100,7 +100,7 @@ const importPalette = () => {
paletteImporter.importData() paletteImporter.importData()
} }
const applyPalette = (data) => { const applyPalette = () => {
emit('applyPalette', getExportedObject()) emit('applyPalette', getExportedObject())
} }

View file

@ -107,7 +107,7 @@ export default {
this.loading = true this.loading = true
usePollsStore().votePoll( usePollsStore().votePoll(
{ id: this.statusId, pollId: this.poll.id, choices: this.choiceIndices } { id: this.statusId, pollId: this.poll.id, choices: this.choiceIndices }
).then(poll => { ).then(() => {
this.loading = false this.loading = false
}) })
} }

View file

@ -105,7 +105,7 @@ export default {
} }
return false return false
}, },
deleteOption (index, event) { deleteOption (index) {
if (this.options.length > 2) { if (this.options.length > 2) {
this.options.splice(index, 1) this.options.splice(index, 1)
} }

View file

@ -280,7 +280,7 @@ const Popover = {
this.updateStyles() this.updateStyles()
}, 1) }, 1)
}, },
onMouseenter (e) { onMouseenter () {
if (this.trigger === 'hover') { if (this.trigger === 'hover') {
this.lockReEntry = false this.lockReEntry = false
clearTimeout(this.graceTimeout) clearTimeout(this.graceTimeout)
@ -288,12 +288,12 @@ const Popover = {
this.showPopover() this.showPopover()
} }
}, },
onMouseleave (e) { onMouseleave () {
if (this.trigger === 'hover' && this.childrenShown.size === 0) { if (this.trigger === 'hover' && this.childrenShown.size === 0) {
this.graceTimeout = setTimeout(() => this.hidePopover(), 1) this.graceTimeout = setTimeout(() => this.hidePopover(), 1)
} }
}, },
onMouseenterContent (e) { onMouseenterContent () {
if (this.trigger === 'hover' && !this.lockReEntry) { if (this.trigger === 'hover' && !this.lockReEntry) {
this.lockReEntry = true this.lockReEntry = true
clearTimeout(this.graceTimeout) clearTimeout(this.graceTimeout)
@ -301,12 +301,12 @@ const Popover = {
this.showPopover() this.showPopover()
} }
}, },
onMouseleaveContent (e) { onMouseleaveContent () {
if (this.trigger === 'hover' && this.childrenShown.size === 0) { if (this.trigger === 'hover' && this.childrenShown.size === 0) {
this.graceTimeout = setTimeout(() => this.hidePopover(), 1) this.graceTimeout = setTimeout(() => this.hidePopover(), 1)
} }
}, },
onClick (e) { onClick () {
if (this.trigger === 'click') { if (this.trigger === 'click') {
if (this.hidden) { if (this.hidden) {
this.showPopover() this.showPopover()
@ -324,10 +324,10 @@ const Popover = {
this.hidePopover() this.hidePopover()
if (this.parentPopover) this.parentPopover.onClickOutside(e) if (this.parentPopover) this.parentPopover.onClickOutside(e)
}, },
onScroll (e) { onScroll () {
this.updateStyles() this.updateStyles()
}, },
onResize (e) { onResize () {
const content = this.$refs.content const content = this.$refs.content
if (!content) return if (!content) return
if (this.oldSize.width !== content.offsetWidth || this.oldSize.height !== content.offsetHeight) { if (this.oldSize.width !== content.offsetWidth || this.oldSize.height !== content.offsetHeight) {

View file

@ -433,7 +433,7 @@ const PostStatusForm = {
if (this.preview) this.previewStatus() if (this.preview) this.previewStatus()
this.saveable = false this.saveable = false
}, },
async postStatus (event, newStatus, opts = {}) { async postStatus (event, newStatus) {
if (this.posting && !this.optimisticPosting) { return } if (this.posting && !this.optimisticPosting) { return }
if (this.disableSubmit) { return } if (this.disableSubmit) { return }
if (this.emojiInputShown) { return } if (this.emojiInputShown) { return }
@ -459,7 +459,7 @@ const PostStatusForm = {
try { try {
await this.setAllMediaDescriptions() await this.setAllMediaDescriptions()
} catch (e) { } catch {
this.error = this.$t('post_status.media_description_error') this.error = this.$t('post_status.media_description_error')
this.posting = false this.posting = false
return return
@ -603,7 +603,7 @@ const PostStatusForm = {
this.showDropIcon = 'hide' this.showDropIcon = 'hide'
} }
}, },
fileDragStop (e) { fileDragStop () {
// The false-setting is done with delay because just using leave-events // The false-setting is done with delay because just using leave-events
// directly caused unwanted flickering, this is not perfect either but // directly caused unwanted flickering, this is not perfect either but
// much less noticable. // much less noticable.
@ -618,7 +618,7 @@ const PostStatusForm = {
this.showDropIcon = 'show' this.showDropIcon = 'show'
} }
}, },
onEmojiInputInput (e) { onEmojiInputInput () {
this.$nextTick(() => { this.$nextTick(() => {
this.resize(this.$refs.textarea) this.resize(this.$refs.textarea)
}) })

View file

@ -3,7 +3,7 @@
v-if="isLoggedIn && !resettingForm" v-if="isLoggedIn && !resettingForm"
:is-open="modalActivated" :is-open="modalActivated"
class="post-form-modal-view" class="post-form-modal-view"
@backdropClicked="closeModal" @backdrop-clicked="closeModal"
> >
<div class="post-form-modal-panel panel"> <div class="post-form-modal-panel panel">
<div class="panel-heading"> <div class="panel-heading">

View file

@ -2,7 +2,6 @@ export default {
props: ['user'], props: ['user'],
computed: { computed: {
subscribeUrl () { subscribeUrl () {
// eslint-disable-next-line no-undef
const serverUrl = new URL(this.user.statusnet_profile_url) const serverUrl = new URL(this.user.statusnet_profile_url)
return `${serverUrl.protocol}//${serverUrl.host}/main/ostatus` return `${serverUrl.protocol}//${serverUrl.host}/main/ostatus`
} }

View file

@ -15,7 +15,7 @@
:model-value="present" :model-value="present"
:disabled="disabled" :disabled="disabled"
class="opt" class="opt"
@update:modelValue="$emit('update:modelValue', !present ? fallback : undefined)" @update:model-value="$emit('update:modelValue', !present ? fallback : undefined)"
/> />
<input <input
:id="name" :id="name"

View file

@ -93,7 +93,7 @@ const EmojiTab = {
this.displayError(resp.error) this.displayError(resp.error)
return Promise.reject(resp) return Promise.reject(resp)
} }
}).then(done => { }).then(() => {
this.$refs.createPackPopover.hidePopover() this.$refs.createPackPopover.hidePopover()
this.packName = this.newPackName this.packName = this.newPackName
@ -110,7 +110,7 @@ const EmojiTab = {
this.displayError(resp.error) this.displayError(resp.error)
return Promise.reject(resp) return Promise.reject(resp)
} }
}).then(done => { }).then(() => {
delete this.editedMetadata[this.packName] delete this.editedMetadata[this.packName]
this.deleteModalVisible = false this.deleteModalVisible = false
@ -167,7 +167,7 @@ const EmojiTab = {
return resultingPromise return resultingPromise
}) })
.then(finished => allPacks) .then(() => allPacks)
.catch(data => { .catch(data => {
this.displayError(data) this.displayError(data)
}) })
@ -226,7 +226,7 @@ const EmojiTab = {
this.displayError(resp.error) this.displayError(resp.error)
return Promise.reject(resp) return Promise.reject(resp)
} }
}).then(done => { }).then(() => {
this.packName = this.remotePackDownloadAs this.packName = this.remotePackDownloadAs
this.remotePackDownloadAs = '' this.remotePackDownloadAs = ''
}) })

View file

@ -312,8 +312,8 @@
new-upload new-upload
:title="$t('admin_dash.emoji.adding_new')" :title="$t('admin_dash.emoji.adding_new')"
:pack-name="packName" :pack-name="packName"
@updatePackFiles="updatePackFiles" @update-pack-files="updatePackFiles"
@displayError="displayError" @display-error="displayError"
> >
<template #trigger> <template #trigger>
<FAIcon <FAIcon
@ -334,8 +334,8 @@
:shortcode="shortcode" :shortcode="shortcode"
:file="file" :file="file"
:pack-name="packName" :pack-name="packName"
@updatePackFiles="updatePackFiles" @update-pack-files="updatePackFiles"
@displayError="displayError" @display-error="displayError"
> >
<template #trigger> <template #trigger>
<StillImage <StillImage

View file

@ -7,7 +7,7 @@
:model-value="visibleState" :model-value="visibleState"
:disabled="shouldBeDisabled" :disabled="shouldBeDisabled"
:indeterminate="isIndeterminate" :indeterminate="isIndeterminate"
@update:modelValue="update" @update:model-value="update"
> >
<span <span
class="label" class="label"

View file

@ -13,7 +13,7 @@
<Select <Select
:model-value="realDraftMode ? draft :state" :model-value="realDraftMode ? draft :state"
:disabled="disabled" :disabled="disabled"
@update:modelValue="update" @update:model-value="update"
> >
<option <option
v-for="option in realOptions" v-for="option in realOptions"

View file

@ -111,7 +111,7 @@
<Checkbox <Checkbox
:model-value="!!expertLevel" :model-value="!!expertLevel"
@update:modelValue="expertLevel = Number($event)" @update:model-value="expertLevel = Number($event)"
> >
{{ $t("settings.expert_mode") }} {{ $t("settings.expert_mode") }}
</Checkbox> </Checkbox>

View file

@ -67,7 +67,7 @@ const AppearanceTab = {
value: i - 1, value: i - 1,
label: this.$t(`settings.style.themes3.hacks.forced_roundness_mode_${mode}`) label: this.$t(`settings.style.themes3.hacks.forced_roundness_mode_${mode}`)
})), })),
underlayOverrideModes: ['none', 'opaque', 'transparent'].map((mode, i) => ({ underlayOverrideModes: ['none', 'opaque', 'transparent'].map((mode) => ({
key: mode, key: mode,
value: mode, value: mode,
label: this.$t(`settings.style.themes3.hacks.underlay_override_mode_${mode}`) label: this.$t(`settings.style.themes3.hacks.underlay_override_mode_${mode}`)
@ -234,7 +234,7 @@ const AppearanceTab = {
cOrange, cOrange,
wallpaper wallpaper
} }
return Object.fromEntries(Object.entries(result).filter(([k, v]) => v)) return Object.fromEntries(Object.entries(result).filter(([, v]) => v))
}) })
return result return result
}, },
@ -276,7 +276,7 @@ const AppearanceTab = {
const { customTheme, customThemeSource } = this.mergedConfig const { customTheme, customThemeSource } = this.mergedConfig
return customTheme != null || customThemeSource != null return customTheme != null || customThemeSource != null
}, },
isCustomStyleUsed (name) { isCustomStyleUsed () {
const { styleCustomData } = this.mergedConfig const { styleCustomData } = this.mergedConfig
return styleCustomData != null return styleCustomData != null
}, },
@ -348,7 +348,7 @@ const AppearanceTab = {
useInterfaceStore().setPaletteCustom(data) useInterfaceStore().setPaletteCustom(data)
this.userPalette = data this.userPalette = data
}, },
resetTheming (name) { resetTheming () {
useInterfaceStore().setStyle('stock') useInterfaceStore().setStyle('stock')
}, },
previewTheme (key, version, input) { previewTheme (key, version, input) {
@ -378,7 +378,7 @@ const AppearanceTab = {
directives: Object.fromEntries( directives: Object.fromEntries(
Object Object
.entries(directives) .entries(directives)
.filter(([k, v]) => k && k !== 'name') .filter(([k]) => k && k !== 'name')
.map(([k, v]) => ['--' + k, 'color | ' + v]) .map(([k, v]) => ['--' + k, 'color | ' + v])
) )
} }

View file

@ -158,7 +158,7 @@
:compact="true" :compact="true"
:apply="true" :apply="true"
:disabled="switchInProgress" :disabled="switchInProgress"
@applyPalette="data => setPaletteCustom(data)" @apply-palette="data => setPaletteCustom(data)"
/> />
</template> </template>
<template v-else-if="customThemeVersion === 'v2'"> <template v-else-if="customThemeVersion === 'v2'">
@ -247,7 +247,7 @@
:label="$t('settings.style.fonts.components.interface')" :label="$t('settings.style.fonts.components.interface')"
:fallback="{ family: 'sans-serif' }" :fallback="{ family: 'sans-serif' }"
no-inherit="1" no-inherit="1"
@update:modelValue="v => updateFont('interface', v)" @update:model-value="v => updateFont('interface', v)"
/> />
</li> </li>
<li> <li>
@ -257,7 +257,7 @@
name="input" name="input"
:fallback="{ family: 'inherit' }" :fallback="{ family: 'inherit' }"
:label="$t('settings.style.fonts.components.input')" :label="$t('settings.style.fonts.components.input')"
@update:modelValue="v => updateFont('input', v)" @update:model-value="v => updateFont('input', v)"
/> />
</li> </li>
<li> <li>
@ -267,7 +267,7 @@
name="post" name="post"
:fallback="{ family: 'inherit' }" :fallback="{ family: 'inherit' }"
:label="$t('settings.style.fonts.components.post')" :label="$t('settings.style.fonts.components.post')"
@update:modelValue="v => updateFont('post', v)" @update:model-value="v => updateFont('post', v)"
/> />
</li> </li>
<li> <li>
@ -277,7 +277,7 @@
name="postCode" name="postCode"
:fallback="{ family: 'monospace' }" :fallback="{ family: 'monospace' }"
:label="$t('settings.style.fonts.components.monospace')" :label="$t('settings.style.fonts.components.monospace')"
@update:modelValue="v => updateFont('monospace', v)" @update:model-value="v => updateFont('monospace', v)"
/> />
</li> </li>
<h3>{{ $t('settings.columns') }}</h3> <h3>{{ $t('settings.columns') }}</h3>

View file

@ -72,7 +72,6 @@ const DataImportExportTab = {
// check is it's a local user // check is it's a local user
if (user && user.is_local) { if (user && user.is_local) {
// append the instance address // append the instance address
// eslint-disable-next-line no-undef
return user.screen_name + '@' + location.hostname return user.screen_name + '@' + location.hostname
} }
return user.screen_name return user.screen_name
@ -80,7 +79,7 @@ const DataImportExportTab = {
}, },
addBackup () { addBackup () {
this.$store.state.api.backendInteractor.addBackup() this.$store.state.api.backendInteractor.addBackup()
.then((res) => { .then(() => {
this.addedBackup = true this.addedBackup = true
this.addBackupError = false this.addBackupError = false
}) })

View file

@ -85,7 +85,6 @@ const MutesAndBlocks = {
// check is it's a local user // check is it's a local user
if (user && user.is_local) { if (user && user.is_local) {
// append the instance address // append the instance address
// eslint-disable-next-line no-undef
return user.screen_name + '@' + location.hostname return user.screen_name + '@' + location.hostname
} }
return user.screen_name return user.screen_name
@ -126,7 +125,7 @@ const MutesAndBlocks = {
return urls.filter(url => !this.user.domainMutes.includes(url)) return urls.filter(url => !this.user.domainMutes.includes(url))
}, },
queryKnownDomains (query) { queryKnownDomains (query) {
return new Promise((resolve, reject) => { return new Promise((resolve) => {
resolve(this.knownDomains.filter(url => url.toLowerCase().includes(query))) resolve(this.knownDomains.filter(url => url.toLowerCase().includes(query)))
}) })
}, },

View file

@ -133,15 +133,14 @@ const ProfileTab = {
const params = { const params = {
note: this.newBio, note: this.newBio,
locked: this.newLocked, locked: this.newLocked,
// Backend notation. // Backend notation.
/* eslint-disable camelcase */
display_name: this.newName, display_name: this.newName,
fields_attributes: this.newFields.filter(el => el != null), fields_attributes: this.newFields.filter(el => el != null),
actor_type: this.actorType, actor_type: this.actorType,
show_role: this.showRole, show_role: this.showRole,
birthday: this.newBirthday || '', birthday: this.newBirthday || '',
show_birthday: this.showBirthday show_birthday: this.showBirthday
/* eslint-enable camelcase */
} }
if (this.emailLanguage) { if (this.emailLanguage) {
@ -167,7 +166,7 @@ const ProfileTab = {
} }
return false return false
}, },
deleteField (index, event) { deleteField (index) {
this.newFields.splice(index, 1) this.newFields.splice(index, 1)
}, },
uploadFile (slot, e) { uploadFile (slot, e) {
@ -190,7 +189,7 @@ const ProfileTab = {
}) })
return return
} }
// eslint-disable-next-line no-undef
const reader = new FileReader() const reader = new FileReader()
reader.onload = ({ target }) => { reader.onload = ({ target }) => {
const img = target.result const img = target.result

View file

@ -89,7 +89,7 @@ const Mfa = {
this.backupCodes.getNewCodes = true this.backupCodes.getNewCodes = true
}, },
confirmBackupCodes () { // confirm getting new backup codes confirmBackupCodes () { // confirm getting new backup codes
this.fetchBackupCodes().then((res) => { this.fetchBackupCodes().then(() => {
this.backupCodes.getNewCodes = false this.backupCodes.getNewCodes = false
}) })
}, },

View file

@ -124,7 +124,7 @@ const SecurityTab = {
}, },
addAlias () { addAlias () {
this.$store.state.api.backendInteractor.addAlias({ alias: this.addAliasTarget }) this.$store.state.api.backendInteractor.addAlias({ alias: this.addAliasTarget })
.then((res) => { .then(() => {
this.addedAlias = true this.addedAlias = true
this.addAliasError = false this.addAliasError = false
this.addAliasTarget = '' this.addAliasTarget = ''

View file

@ -78,14 +78,14 @@ export default {
Preview, Preview,
VirtualDirectivesTab VirtualDirectivesTab
}, },
setup (props, context) { setup () {
const exports = {} const exports = {}
const interfaceStore = useInterfaceStore() const interfaceStore = useInterfaceStore()
// All rules that are made by editor // All rules that are made by editor
const allEditedRules = ref(interfaceStore.styleDataUsed || {}) const allEditedRules = ref(interfaceStore.styleDataUsed || {})
const styleDataUsed = computed(() => interfaceStore.styleDataUsed) const styleDataUsed = computed(() => interfaceStore.styleDataUsed)
watch([styleDataUsed], (value) => { watch([styleDataUsed], () => {
onImport(interfaceStore.styleDataUsed) onImport(interfaceStore.styleDataUsed)
}, { once: true }) }, { once: true })
@ -227,7 +227,7 @@ export default {
componentKeysAll componentKeysAll
.map( .map(
key => [key, componentsContext(key).default] key => [key, componentsContext(key).default]
).filter(([key, component]) => !component.virtual && !component.notEditable) ).filter(([, component]) => !component.virtual && !component.notEditable)
) )
exports.componentsMap = componentsMap exports.componentsMap = componentsMap
const componentKeys = [...componentsMap.keys()] const componentKeys = [...componentsMap.keys()]

View file

@ -147,7 +147,7 @@
> >
<Checkbox <Checkbox
:value="selectedState.has(state)" :value="selectedState.has(state)"
@update:modelValue="(v) => updateSelectedStates(state, v)" @update:model-value="(v) => updateSelectedStates(state, v)"
> >
{{ state }} {{ state }}
</Checkbox> </Checkbox>
@ -337,7 +337,7 @@
:no-preview="true" :no-preview="true"
:compact="true" :compact="true"
:static-vars="staticVars" :static-vars="staticVars"
@subShadowSelected="onSubShadow" @sub-shadow-selected="onSubShadow"
/> />
</div> </div>
</tab-switcher> </tab-switcher>
@ -373,8 +373,8 @@
:model-value="palettes" :model-value="palettes"
:selected-id="selectedPaletteId" :selected-id="selectedPaletteId"
:get-add-value="getNewPalette" :get-add-value="getNewPalette"
@update:modelValue="onPalettesUpdate" @update:model-value="onPalettesUpdate"
@update:selectedId="e => selectedPaletteId = e" @update:selected-id="e => selectedPaletteId = e"
/> />
<div class="list-edit-area"> <div class="list-edit-area">
<StringSetting <StringSetting
@ -393,7 +393,7 @@
key="variables" key="variables"
:label="$t('settings.style.themes3.editor.variables_tab')" :label="$t('settings.style.themes3.editor.variables_tab')"
:model-value="virtualDirectives" :model-value="virtualDirectives"
@update:modelValue="updateVirtualDirectives" @update:model-value="updateVirtualDirectives"
/> />
</tab-switcher> </tab-switcher>
</div> </div>

View file

@ -28,8 +28,8 @@
:model-value="modelValue" :model-value="modelValue"
:selected-id="selectedVirtualDirectiveId" :selected-id="selectedVirtualDirectiveId"
:get-add-value="getNewVirtualDirective" :get-add-value="getNewVirtualDirective"
@update:modelValue="e => emit('update:modelValue', e)" @update:model-value="e => emit('update:modelValue', e)"
@update:selectedId="e => selectedVirtualDirectiveId = e" @update:selected-id="e => selectedVirtualDirectiveId = e"
/> />
<div class="list-edit-area"> <div class="list-edit-area">
<div class="variable-selector"> <div class="variable-selector">

View file

@ -480,7 +480,7 @@ export default {
} }
this.dismissWarning() this.dismissWarning()
}, },
loadThemeFromLocalStorage (confirmLoadSource = false, forceSnapshot = false) { loadThemeFromLocalStorage (confirmLoadSource = false) {
const theme = this.themeDataUsed?.source const theme = this.themeDataUsed?.source
if (theme) { if (theme) {
this.loadTheme( this.loadTheme(
@ -536,7 +536,7 @@ export default {
this.tempImportFile = parsed this.tempImportFile = parsed
this.loadTheme(parsed, 'file', forceSource) this.loadTheme(parsed, 'file', forceSource)
}, },
onImportFailure (result) { onImportFailure () {
useInterfaceStore().pushGlobalNotice({ messageKey: 'settings.invalid_theme_imported', level: 'error' }) useInterfaceStore().pushGlobalNotice({ messageKey: 'settings.invalid_theme_imported', level: 'error' })
}, },
importValidator (parsed) { importValidator (parsed) {
@ -757,7 +757,7 @@ export default {
} }
}, },
selected () { selected () {
this.selectedTheme = Object.entries(this.availableStyles).find(([k, s]) => { this.selectedTheme = Object.entries(this.availableStyles).find(([, s]) => {
if (Array.isArray(s)) { if (Array.isArray(s)) {
return s[0] === this.selected return s[0] === this.selected
} else { } else {

View file

@ -151,7 +151,7 @@ export default {
} }
}, },
watch: { watch: {
selected (value) { selected () {
this.$emit('subShadowSelected', this.selectedId) this.$emit('subShadowSelected', this.selectedId)
} }
}, },

View file

@ -35,7 +35,7 @@
:selected-id="selectedId" :selected-id="selectedId"
:get-add-value="getNewSubshadow" :get-add-value="getNewSubshadow"
:disabled="disabled" :disabled="disabled"
@update:selectedId="onSelectChange" @update:selected-id="onSelectChange"
/> />
</div> </div>
<div class="shadow-tweak"> <div class="shadow-tweak">
@ -170,12 +170,12 @@
:fallback="getColorFallback" :fallback="getColorFallback"
:show-optional-checkbox="false" :show-optional-checkbox="false"
name="shadow" name="shadow"
@update:modelValue="e => updateProperty('color', e)" @update:model-value="e => updateProperty('color', e)"
/> />
<OpacityInput <OpacityInput
:model-value="selected?.alpha" :model-value="selected?.alpha"
:disabled="disabled || !present" :disabled="disabled || !present"
@update:modelValue="e => updateProperty('alpha', e)" @update:model-value="e => updateProperty('alpha', e)"
/> />
<i18n-t <i18n-t
scope="global" scope="global"

View file

@ -38,7 +38,7 @@ const shoutPanel = {
} }
}, },
watch: { watch: {
messages (newVal) { messages () {
const scrollEl = this.$el.querySelector('.chat-window') const scrollEl = this.$el.querySelector('.chat-window')
if (!scrollEl) return if (!scrollEl) return
if (scrollEl.scrollTop + scrollEl.offsetHeight + 20 > scrollEl.scrollHeight) { if (scrollEl.scrollTop + scrollEl.offsetHeight + 20 > scrollEl.scrollHeight) {

View file

@ -403,7 +403,7 @@
:controlled-toggle-showing-long-subject="controlledToggleShowingLongSubject" :controlled-toggle-showing-long-subject="controlledToggleShowingLongSubject"
@mediaplay="addMediaPlaying($event)" @mediaplay="addMediaPlaying($event)"
@mediapause="removeMediaPlaying($event)" @mediapause="removeMediaPlaying($event)"
@parseReady="setHeadTailLinks" @parse-ready="setHeadTailLinks"
/> />
<article <article
@ -539,7 +539,7 @@
v-if="!noHeading && !isPreview" v-if="!noHeading && !isPreview"
:status="status" :status="status"
:replying="replying" :replying="replying"
@toggleReplying="toggleReplying" @toggle-replying="toggleReplying"
/> />
</div> </div>
</div> </div>

View file

@ -109,7 +109,7 @@ export const BUTTONS = [{
status.user.id === currentUser.id && status.user.id === currentUser.id &&
PUBLIC_SCOPES.has(status.visibility) PUBLIC_SCOPES.has(status.visibility)
}, },
action ({ status, dispatch, emit }) { action ({ status, dispatch }) {
if (status.pinned) { if (status.pinned) {
return dispatch('unpinStatus', { id: status.id }) return dispatch('unpinStatus', { id: status.id })
} else { } else {
@ -130,7 +130,7 @@ export const BUTTONS = [{
? 'status.unbookmark' ? 'status.unbookmark'
: 'status.bookmark', : 'status.bookmark',
if: ({ loggedIn }) => loggedIn, if: ({ loggedIn }) => loggedIn,
action ({ status, dispatch, emit }) { action ({ status, dispatch }) {
if (status.bookmarked) { if (status.bookmarked) {
return dispatch('unbookmark', { id: status.id }) return dispatch('unbookmark', { id: status.id })
} else { } else {
@ -175,7 +175,7 @@ export const BUTTONS = [{
currentUser.privileges.includes('messages_delete') currentUser.privileges.includes('messages_delete')
) )
}, },
confirm: ({ status, getters }) => getters.mergedConfig.modalOnDelete, confirm: ({ getters }) => getters.mergedConfig.modalOnDelete,
confirmStrings: { confirmStrings: {
title: 'status.delete_confirm_title', title: 'status.delete_confirm_title',
body: 'status.delete_confirm', body: 'status.delete_confirm',

View file

@ -52,7 +52,7 @@
:faint="compact" :faint="compact"
:greentext="mergedConfig.greentext" :greentext="mergedConfig.greentext"
:attentions="status.attentions" :attentions="status.attentions"
@parseReady="onParseReady" @parse-ready="onParseReady"
/> />
<button <button

View file

@ -14,7 +14,7 @@
:toggle-showing-tall="toggleShowingTall" :toggle-showing-tall="toggleShowingTall"
:toggle-expanding-subject="toggleExpandingSubject" :toggle-expanding-subject="toggleExpandingSubject"
:toggle-showing-long-subject="toggleShowingLongSubject" :toggle-showing-long-subject="toggleShowingLongSubject"
@parseReady="$emit('parseReady', $event)" @parse-ready="$emit('parseReady', $event)"
> >
<div v-if="status.poll && status.poll.options && !compact"> <div v-if="status.poll && status.poll.options && !compact">
<Poll <Poll

View file

@ -2,7 +2,7 @@
<Modal <Modal
v-if="modalActivated" v-if="modalActivated"
class="status-history-modal-view" class="status-history-modal-view"
@backdropClicked="closeModal" @backdrop-clicked="closeModal"
> >
<div class="status-history-modal-panel panel"> <div class="status-history-modal-panel panel">
<div class="panel-heading"> <div class="panel-heading">

View file

@ -34,8 +34,8 @@ const StatusPopover = {
return return
} }
this.$store.dispatch('fetchStatus', this.statusId) this.$store.dispatch('fetchStatus', this.statusId)
.then(data => (this.error = false)) .then(() => (this.error = false))
.catch(e => (this.error = true)) .catch(() => (this.error = true))
} }
} }
}, },

View file

@ -81,7 +81,7 @@ const ThreadTree = {
toggleCurrentProp (name) { toggleCurrentProp (name) {
this.toggleStatusContentProperty(this.status.id, name) this.toggleStatusContentProperty(this.status.id, name)
}, },
setCurrentProp (name, newVal) { setCurrentProp (name) {
this.setStatusContentProperty(this.status.id, name) this.setStatusContentProperty(this.status.id, name)
} }
} }

View file

@ -32,7 +32,7 @@
:dive="dive ? () => dive(status.id) : undefined" :dive="dive ? () => dive(status.id) : undefined"
@goto="setHighlight" @goto="setHighlight"
@toggleExpanded="toggleExpanded" @toggle-expanded="toggleExpanded"
/> />
<div <div
v-if="currentReplies.length && threadShowing" v-if="currentReplies.length && threadShowing"

View file

@ -241,7 +241,7 @@ const Timeline = {
// statuses will be nearby statuses before and after it // statuses will be nearby statuses before and after it
this.virtualScrollIndex = approxIndex this.virtualScrollIndex = approxIndex
}, },
scrollLoad (e) { scrollLoad () {
const bodyBRect = document.body.getBoundingClientRect() const bodyBRect = document.body.getBoundingClientRect()
const height = Math.max(bodyBRect.height, -(bodyBRect.y)) const height = Math.max(bodyBRect.height, -(bodyBRect.y))
if (this.timeline.loading === false && if (this.timeline.loading === false &&

View file

@ -85,7 +85,6 @@ export default {
return this.user.id !== this.$store.state.users.currentUser.id return this.user.id !== this.$store.state.users.currentUser.id
}, },
subscribeUrl () { subscribeUrl () {
// eslint-disable-next-line no-undef
const serverUrl = new URL(this.user.statusnet_profile_url) const serverUrl = new URL(this.user.statusnet_profile_url)
return `${serverUrl.protocol}//${serverUrl.host}/main/ostatus` return `${serverUrl.protocol}//${serverUrl.host}/main/ostatus`
}, },

View file

@ -81,7 +81,7 @@ const UserListMenu = {
const user = this.user const user = this.user
const { id, name } = user const { id, name } = user
store.state.api.backendInteractor.deleteUser({ user }) store.state.api.backendInteractor.deleteUser({ user })
.then(e => { .then(() => {
this.$store.dispatch('markStatusesAsDeleted', status => user.id === status.user.id) this.$store.dispatch('markStatusesAsDeleted', status => user.id === status.user.id)
const isProfile = this.$route.name === 'external-user-profile' || this.$route.name === 'user-profile' const isProfile = this.$route.name === 'external-user-profile' || this.$route.name === 'user-profile'
const isTargetUser = this.$route.params.name === name || this.$route.params.id === id const isTargetUser = this.$route.params.name === name || this.$route.params.id === id

View file

@ -1,7 +1,7 @@
<template> <template>
<Modal <Modal
v-if="isOpen" v-if="isOpen"
@backdropClicked="closeModal" @backdrop-clicked="closeModal"
> >
<div class="user-reporting-panel panel"> <div class="user-reporting-panel panel">
<div class="panel-heading"> <div class="panel-heading">

View file

@ -24,7 +24,7 @@ const VideoAttachment = {
} }
this.$emit('play') this.$emit('play')
}, },
onPaused (e) { onPaused () {
this.$emit('pause') this.$emit('pause')
}, },
setHasAudio (e) { setHasAudio (e) {

View file

@ -15,7 +15,7 @@ const WhoToFollow = {
}, },
methods: { methods: {
showWhoToFollow (reply) { showWhoToFollow (reply) {
reply.forEach((i, index) => { reply.forEach((i) => {
this.$store.state.api.backendInteractor.fetchUser({ id: i.acct }) this.$store.state.api.backendInteractor.fetchUser({ id: i.acct })
.then((externalUser) => { .then((externalUser) => {
if (!externalUser.error) { if (!externalUser.error) {

View file

@ -54,7 +54,7 @@ const WhoToFollowPanel = {
} }
}, },
watch: { watch: {
user: function (user, oldUser) { user: function () {
if (this.suggestionsEnabled) { if (this.suggestionsEnabled) {
getWhoToFollow(this) getWhoToFollow(this)
} }
@ -62,7 +62,7 @@ const WhoToFollowPanel = {
}, },
mounted: mounted:
function () { function () {
this.usersToFollow = new Array(3).fill().map(x => ( this.usersToFollow = new Array(3).fill().map(() => (
{ {
img: this.$store.state.instance.defaultAvatar, img: this.$store.state.instance.defaultAvatar,
name: '', name: '',

View file

@ -1,4 +1,3 @@
/* eslint-disable import/no-webpack-loader-syntax */
// This module exports only the notification part of the i18n, // This module exports only the notification part of the i18n,
// which is useful for the service worker // which is useful for the service worker

View file

@ -1,9 +1,11 @@
import EventTargetPolyfill from '@ungap/event-target' import EventTargetPolyfill from '@ungap/event-target'
try { try {
/* eslint-disable no-new */ // for some reason eslint both likes and dislikes
new EventTarget() // no-new here so we just call something useless
/* eslint-enable no-new */ // so it stops reporting this file
} catch (e) { const et = new EventTarget()
et.dispatchEvent()
} catch {
window.EventTarget = EventTargetPolyfill window.EventTarget = EventTargetPolyfill
} }

View file

@ -1,3 +1,4 @@
/* global process */
import { createStore } from 'vuex' import { createStore } from 'vuex'
import { createPinia } from 'pinia' import { createPinia } from 'pinia'

View file

@ -60,7 +60,7 @@ const adminSettingsStorage = {
} }
}, },
actions: { actions: {
loadFrontendsStuff ({ state, rootState, dispatch, commit }) { loadFrontendsStuff ({ rootState, commit }) {
rootState.api.backendInteractor.fetchAvailableFrontends() rootState.api.backendInteractor.fetchAvailableFrontends()
.then(frontends => commit('setAvailableFrontends', { frontends })) .then(frontends => commit('setAvailableFrontends', { frontends }))
}, },
@ -84,7 +84,7 @@ const adminSettingsStorage = {
.then(backendDescriptions => dispatch('setInstanceAdminDescriptions', { backendDescriptions })) .then(backendDescriptions => dispatch('setInstanceAdminDescriptions', { backendDescriptions }))
} }
}, },
setInstanceAdminSettings ({ state, commit, dispatch }, { backendDbConfig }) { setInstanceAdminSettings ({ state, commit }, { backendDbConfig }) {
const config = state.config || {} const config = state.config || {}
const modifiedPaths = new Set() const modifiedPaths = new Set()
backendDbConfig.configs.forEach(c => { backendDbConfig.configs.forEach(c => {
@ -108,7 +108,7 @@ const adminSettingsStorage = {
commit('updateAdminSettings', { config, modifiedPaths }) commit('updateAdminSettings', { config, modifiedPaths })
commit('resetAdminDraft') commit('resetAdminDraft')
}, },
setInstanceAdminDescriptions ({ state, commit, dispatch }, { backendDescriptions }) { setInstanceAdminDescriptions ({ commit }, { backendDescriptions }) {
const convert = ({ children, description, label, key = '<ROOT>', group, suggestions }, path, acc) => { const convert = ({ children, description, label, key = '<ROOT>', group, suggestions }, path, acc) => {
const newPath = group ? [group, key] : [key] const newPath = group ? [group, key] : [key]
const obj = { description, label, suggestions } const obj = { description, label, suggestions }
@ -127,7 +127,7 @@ const adminSettingsStorage = {
// This action takes draft state, diffs it with live config state and then pushes // This action takes draft state, diffs it with live config state and then pushes
// only differences between the two. Difference detection only work up to subkey (third) level. // only differences between the two. Difference detection only work up to subkey (third) level.
pushAdminDraft ({ rootState, state, commit, dispatch }) { pushAdminDraft ({ rootState, state, dispatch }) {
// TODO cleanup paths in modifiedPaths // TODO cleanup paths in modifiedPaths
const convert = (value) => { const convert = (value) => {
if (typeof value !== 'object') { if (typeof value !== 'object') {
@ -177,7 +177,7 @@ const adminSettingsStorage = {
.then(() => rootState.api.backendInteractor.fetchInstanceDBConfig()) .then(() => rootState.api.backendInteractor.fetchInstanceDBConfig())
.then(backendDbConfig => dispatch('setInstanceAdminSettings', { backendDbConfig })) .then(backendDbConfig => dispatch('setInstanceAdminSettings', { backendDbConfig }))
}, },
pushAdminSetting ({ rootState, state, commit, dispatch }, { path, value }) { pushAdminSetting ({ rootState, dispatch }, { path, value }) {
const [group, key, ...rest] = Array.isArray(path) ? path : path.split(/\./g) const [group, key, ...rest] = Array.isArray(path) ? path : path.split(/\./g)
const clone = {} // not actually cloning the entire thing to avoid excessive writes const clone = {} // not actually cloning the entire thing to avoid excessive writes
set(clone, rest, value) set(clone, rest, value)
@ -205,7 +205,7 @@ const adminSettingsStorage = {
.then(() => rootState.api.backendInteractor.fetchInstanceDBConfig()) .then(() => rootState.api.backendInteractor.fetchInstanceDBConfig())
.then(backendDbConfig => dispatch('setInstanceAdminSettings', { backendDbConfig })) .then(backendDbConfig => dispatch('setInstanceAdminSettings', { backendDbConfig }))
}, },
resetAdminSetting ({ rootState, state, commit, dispatch }, { path }) { resetAdminSetting ({ rootState, state, dispatch }, { path }) {
const [group, key, subkey] = path.split(/\./g) const [group, key, subkey] = path.split(/\./g)
state.modifiedPaths.delete(path) state.modifiedPaths.delete(path)

View file

@ -27,7 +27,7 @@ const api = {
addFetcher (state, { fetcherName, fetcher }) { addFetcher (state, { fetcherName, fetcher }) {
state.fetchers[fetcherName] = fetcher state.fetchers[fetcherName] = fetcher
}, },
removeFetcher (state, { fetcherName, fetcher }) { removeFetcher (state, { fetcherName }) {
state.fetchers[fetcherName].stop() state.fetchers[fetcherName].stop()
delete state.fetchers[fetcherName] delete state.fetchers[fetcherName]
}, },
@ -294,7 +294,7 @@ const api = {
setWsToken (store, token) { setWsToken (store, token) {
store.commit('setWsToken', token) store.commit('setWsToken', token)
}, },
initializeSocket ({ dispatch, commit, state, rootState }) { initializeSocket ({ commit, state, rootState }) {
// Set up websocket connection // Set up websocket connection
const token = state.wsToken const token = state.wsToken
if (rootState.instance.shoutAvailable && typeof token !== 'undefined' && state.socket === null) { if (rootState.instance.shoutAvailable && typeof token !== 'undefined' && state.socket === null) {

View file

@ -19,19 +19,19 @@ const resetState = (state) => {
// getters // getters
const getters = { const getters = {
settings: (state, getters) => { settings: (state) => {
return state.settings return state.settings
}, },
requiredPassword: (state, getters, rootState) => { requiredPassword: (state) => {
return state.strategy === PASSWORD_STRATEGY return state.strategy === PASSWORD_STRATEGY
}, },
requiredToken: (state, getters, rootState) => { requiredToken: (state) => {
return state.strategy === TOKEN_STRATEGY return state.strategy === TOKEN_STRATEGY
}, },
requiredTOTP: (state, getters, rootState) => { requiredTOTP: (state) => {
return state.strategy === TOTP_STRATEGY return state.strategy === TOTP_STRATEGY
}, },
requiredRecovery: (state, getters, rootState) => { requiredRecovery: (state) => {
return state.strategy === RECOVERY_STRATEGY return state.strategy === RECOVERY_STRATEGY
} }
} }
@ -67,10 +67,10 @@ const mutations = {
// actions // actions
const actions = { const actions = {
// eslint-disable-next-line camelcase
async login ({ state, dispatch, commit }, { access_token }) { async login ({ state, dispatch, commit }, { access_token: accessToken }) {
commit('setToken', access_token, { root: true }) commit('setToken', accessToken, { root: true })
await dispatch('loginUser', access_token, { root: true }) await dispatch('loginUser', accessToken, { root: true })
resetState(state) resetState(state)
} }
} }

View file

@ -53,7 +53,7 @@ const chats = {
stopFetchingChats ({ commit }) { stopFetchingChats ({ commit }) {
commit('setChatListFetcher', { fetcher: undefined }) commit('setChatListFetcher', { fetcher: undefined })
}, },
fetchChats ({ dispatch, rootState, commit }, params = {}) { fetchChats ({ dispatch, rootState }) {
return rootState.api.backendInteractor.chats() return rootState.api.backendInteractor.chats()
.then(({ chats }) => { .then(({ chats }) => {
dispatch('addNewChats', { chats }) dispatch('addNewChats', { chats })
@ -73,13 +73,13 @@ const chats = {
}, },
// Opened Chats // Opened Chats
startFetchingCurrentChat ({ commit, dispatch }, { fetcher }) { startFetchingCurrentChat ({ dispatch }, { fetcher }) {
dispatch('setCurrentChatFetcher', { fetcher }) dispatch('setCurrentChatFetcher', { fetcher })
}, },
setCurrentChatFetcher ({ rootState, commit }, { fetcher }) { setCurrentChatFetcher ({ commit }, { fetcher }) {
commit('setCurrentChatFetcher', { fetcher }) commit('setCurrentChatFetcher', { fetcher })
}, },
addOpenedChat ({ rootState, commit, dispatch }, { chat }) { addOpenedChat ({ commit, dispatch }, { chat }) {
commit('addOpenedChat', { dispatch, chat: parseChat(chat) }) commit('addOpenedChat', { dispatch, chat: parseChat(chat) })
dispatch('addNewUsers', [chat.account]) dispatch('addNewUsers', [chat.account])
}, },
@ -89,7 +89,7 @@ const chats = {
resetChatNewMessageCount ({ commit }, value) { resetChatNewMessageCount ({ commit }, value) {
commit('resetChatNewMessageCount', value) commit('resetChatNewMessageCount', value)
}, },
clearCurrentChat ({ rootState, commit, dispatch }, value) { clearCurrentChat ({ commit }) {
commit('setCurrentChatId', { chatId: undefined }) commit('setCurrentChatId', { chatId: undefined })
commit('setCurrentChatFetcher', { fetcher: undefined }) commit('setCurrentChatFetcher', { fetcher: undefined })
}, },
@ -111,7 +111,7 @@ const chats = {
dispatch('clearCurrentChat') dispatch('clearCurrentChat')
commit('resetChats', { commit }) commit('resetChats', { commit })
}, },
clearOpenedChats ({ rootState, commit, dispatch, rootGetters }) { clearOpenedChats ({ commit }) {
commit('clearOpenedChats', { commit }) commit('clearOpenedChats', { commit })
}, },
handleMessageError ({ commit }, value) { handleMessageError ({ commit }, value) {
@ -122,7 +122,7 @@ const chats = {
} }
}, },
mutations: { mutations: {
setChatListFetcher (state, { commit, fetcher }) { setChatListFetcher (state, { fetcher }) {
const prevFetcher = state.chatListFetcher const prevFetcher = state.chatListFetcher
if (prevFetcher) { if (prevFetcher) {
prevFetcher.stop() prevFetcher.stop()
@ -136,7 +136,7 @@ const chats = {
} }
state.fetcher = fetcher && fetcher() state.fetcher = fetcher && fetcher()
}, },
addOpenedChat (state, { _dispatch, chat }) { addOpenedChat (state, { chat }) {
state.currentChatId = chat.id state.currentChatId = chat.id
state.openedChats[chat.id] = chat state.openedChats[chat.id] = chat
@ -165,7 +165,7 @@ const chats = {
} }
}) })
}, },
updateChat (state, { _dispatch, chat: updatedChat, _rootGetters }) { updateChat (state, { chat: updatedChat }) {
const chat = getChatById(state, updatedChat.id) const chat = getChatById(state, updatedChat.id)
if (chat) { if (chat) {
chat.lastMessage = updatedChat.lastMessage chat.lastMessage = updatedChat.lastMessage
@ -175,7 +175,7 @@ const chats = {
if (!chat) { state.chatList.data.unshift(updatedChat) } if (!chat) { state.chatList.data.unshift(updatedChat) }
state.chatList.idStore[updatedChat.id] = updatedChat state.chatList.idStore[updatedChat.id] = updatedChat
}, },
deleteChat (state, { _dispatch, id, _rootGetters }) { deleteChat (state, { id }) {
state.chats.data = state.chats.data.filter(conversation => state.chats.data = state.chats.data.filter(conversation =>
conversation.last_status.id !== id conversation.last_status.id !== id
) )
@ -206,7 +206,7 @@ const chats = {
chatService.deleteMessage(chatMessageService, messageId) chatService.deleteMessage(chatMessageService, messageId)
} }
}, },
resetChatNewMessageCount (state, _value) { resetChatNewMessageCount (state) {
const chatMessageService = state.openedChatMessageServices[state.currentChatId] const chatMessageService = state.openedChatMessageServices[state.currentChatId]
chatService.resetNewMessageCount(chatMessageService) chatService.resetNewMessageCount(chatMessageService)
}, },

View file

@ -38,13 +38,13 @@ export const multiChoiceProperties = [
// caching the instance default properties // caching the instance default properties
export const instanceDefaultProperties = Object.entries(defaultState) export const instanceDefaultProperties = Object.entries(defaultState)
.filter(([key, value]) => value === undefined) .filter(([, value]) => value === undefined)
.map(([key, value]) => key) .map(([key]) => key)
const config = { const config = {
state: { ...defaultState }, state: { ...defaultState },
getters: { getters: {
defaultConfig (state, getters, rootState, rootGetters) { defaultConfig (state, getters, rootState) {
const { instance } = rootState const { instance } = rootState
return { return {
...defaultState, ...defaultState,
@ -58,7 +58,7 @@ const config = {
return { return {
...defaultConfig, ...defaultConfig,
// Do not override with undefined // Do not override with undefined
...Object.fromEntries(Object.entries(state).filter(([k, v]) => v !== undefined)) ...Object.fromEntries(Object.entries(state).filter(([, v]) => v !== undefined))
} }
} }
}, },
@ -94,10 +94,10 @@ const config = {
name => dispatch('setOption', { name, value: data[name] }) name => dispatch('setOption', { name, value: data[name] })
) )
}, },
setHighlight ({ commit, dispatch }, { user, color, type }) { setHighlight ({ commit }, { user, color, type }) {
commit('setHighlight', { user, color, type }) commit('setHighlight', { user, color, type })
}, },
setOptionTemporarily ({ commit, dispatch, state, rootState }, { name, value }) { setOptionTemporarily ({ commit, dispatch, state }, { name, value }) {
if (useInterfaceStore().temporaryChangesTimeoutId !== null) { if (useInterfaceStore().temporaryChangesTimeoutId !== null) {
console.warn('Can\'t track more than one temporary change') console.warn('Can\'t track more than one temporary change')
return return

View file

@ -36,7 +36,10 @@ export const notifications = {
}) })
}, },
clearNotifications (state) { clearNotifications (state) {
state = emptyNotifications() const blankState = defaultState()
Object.keys(state).forEach(k => {
state[k] = blankState[k]
})
}, },
updateNotificationsMinMaxId (state, id) { updateNotificationsMinMaxId (state, id) {
state.maxId = id > state.maxId ? id : state.maxId state.maxId = id > state.maxId ? id : state.maxId
@ -67,7 +70,7 @@ export const notifications = {
} }
}, },
actions: { actions: {
addNewNotifications (store, { notifications, older }) { addNewNotifications (store, { notifications }) {
const { commit, dispatch, state, rootState } = store const { commit, dispatch, state, rootState } = store
const validNotifications = notifications.filter((notification) => { const validNotifications = notifications.filter((notification) => {
// If invalid notification, update ids but don't add it to store // If invalid notification, update ids but don't add it to store
@ -130,10 +133,10 @@ export const notifications = {
} }
} }
}, },
setNotificationsLoading ({ rootState, commit }, { value }) { setNotificationsLoading ({ commit }, { value }) {
commit('setNotificationsLoading', { value }) commit('setNotificationsLoading', { value })
}, },
setNotificationsSilence ({ rootState, commit }, { value }) { setNotificationsSilence ({ commit }, { value }) {
commit('setNotificationsSilence', { value }) commit('setNotificationsSilence', { value })
}, },
markNotificationsAsSeen ({ rootState, state, commit }) { markNotificationsAsSeen ({ rootState, state, commit }) {
@ -155,14 +158,14 @@ export const notifications = {
closeDesktopNotification(rootState, { id }) closeDesktopNotification(rootState, { id })
}) })
}, },
dismissNotificationLocal ({ rootState, commit }, { id }) { dismissNotificationLocal ({ commit }, { id }) {
commit('dismissNotification', { id }) commit('dismissNotification', { id })
}, },
dismissNotification ({ rootState, commit }, { id }) { dismissNotification ({ rootState, commit }, { id }) {
commit('dismissNotification', { id }) commit('dismissNotification', { id })
rootState.api.backendInteractor.dismissNotification({ id }) rootState.api.backendInteractor.dismissNotification({ id })
}, },
updateNotification ({ rootState, commit }, { id, updater }) { updateNotification ({ commit }, { id, updater }) {
commit('updateNotification', { id, updater }) commit('updateNotification', { id, updater })
} }
} }

View file

@ -118,7 +118,7 @@ const profileConfig = {
} }
}, },
actions: { actions: {
setProfileOption ({ rootState, state, commit, dispatch }, { name, value }) { setProfileOption ({ rootState, state, commit }, { name, value }) {
const oldValue = get(state, name) const oldValue = get(state, name)
const map = settingsMap[name] const map = settingsMap[name]
if (!map) throw new Error('Invalid server-side setting') if (!map) throw new Error('Invalid server-side setting')

View file

@ -200,7 +200,7 @@ const _mergeJournal = (...journals) => {
.sort((a, b) => a.timestamp > b.timestamp ? 1 : -1) .sort((a, b) => a.timestamp > b.timestamp ? 1 : -1)
} }
export const _mergePrefs = (recent, stale, allFlagKeys) => { export const _mergePrefs = (recent, stale) => {
if (!stale) return recent if (!stale) return recent
if (!recent) return stale if (!recent) return stale
const { _journal: recentJournal, ...recentData } = recent const { _journal: recentJournal, ...recentData } = recent
@ -217,7 +217,7 @@ export const _mergePrefs = (recent, stale, allFlagKeys) => {
*/ */
const resultOutput = { ...recentData } const resultOutput = { ...recentData }
const totalJournal = _mergeJournal(staleJournal, recentJournal) const totalJournal = _mergeJournal(staleJournal, recentJournal)
totalJournal.forEach(({ path, timestamp, operation, command, args }) => { totalJournal.forEach(({ path, operation, args }) => {
if (path.startsWith('_')) { if (path.startsWith('_')) {
console.error(`journal contains entry to edit internal (starts with _) field '${path}', something is incorrect here, ignoring.`) console.error(`journal contains entry to edit internal (starts with _) field '${path}', something is incorrect here, ignoring.`)
return return
@ -303,10 +303,13 @@ export const _doMigrations = (cache) => {
} }
export const mutations = { export const mutations = {
clearServerSideStorage (state, userData) { clearServerSideStorage (state) {
state = { ...cloneDeep(defaultState) } const blankState = { ...cloneDeep(defaultState) }
Object.keys(state).forEach(k => {
state[k] = blankState[k]
})
}, },
setServerSideStorage (state, userData, test) { setServerSideStorage (state, userData) {
const live = userData.storage const live = userData.storage
state.raw = live state.raw = live
let cache = state.cache let cache = state.cache
@ -334,8 +337,10 @@ export const mutations = {
if (!needUpload && recent && stale) { if (!needUpload && recent && stale) {
console.debug('Checking if data needs merging...') console.debug('Checking if data needs merging...')
// discarding timestamps and versions // discarding timestamps and versions
/* eslint-disable no-unused-vars */
const { _timestamp: _0, _version: _1, ...recentData } = recent const { _timestamp: _0, _version: _1, ...recentData } = recent
const { _timestamp: _2, _version: _3, ...staleData } = stale const { _timestamp: _2, _version: _3, ...staleData } = stale
/* eslint-enable no-unused-vars */
dirty = !isEqual(recentData, staleData) dirty = !isEqual(recentData, staleData)
console.debug(`Data ${dirty ? 'needs' : 'doesn\'t need'} merging`) console.debug(`Data ${dirty ? 'needs' : 'doesn\'t need'} merging`)
} }

View file

@ -223,7 +223,7 @@ const addNewStatuses = (state, { statuses, showImmediately = false, timeline, us
return status return status
} }
const favoriteStatus = (favorite, counter) => { const favoriteStatus = (favorite) => {
const status = find(allStatuses, { id: favorite.in_reply_to_status_id }) const status = find(allStatuses, { id: favorite.in_reply_to_status_id })
if (status) { if (status) {
// This is our favorite, so the relevant bit. // This is our favorite, so the relevant bit.
@ -273,7 +273,7 @@ const addNewStatuses = (state, { statuses, showImmediately = false, timeline, us
favoriteStatus(favorite) favoriteStatus(favorite)
} }
}, },
follow: (follow) => { follow: () => {
// NOOP, it is known status but we don't do anything about it for now // NOOP, it is known status but we don't do anything about it for now
}, },
default: (unknown) => { default: (unknown) => {
@ -433,7 +433,7 @@ export const mutations = {
newStatus.fave_num = newStatus.favoritedBy.length newStatus.fave_num = newStatus.favoritedBy.length
newStatus.favorited = !!newStatus.favoritedBy.find(({ id }) => currentUser.id === id) newStatus.favorited = !!newStatus.favoritedBy.find(({ id }) => currentUser.id === id)
}, },
addEmojiReactionsBy (state, { id, emojiReactions, currentUser }) { addEmojiReactionsBy (state, { id, emojiReactions }) {
const status = state.allStatusesObject[id] const status = state.allStatusesObject[id]
status.emoji_reactions = emojiReactions status.emoji_reactions = emojiReactions
}, },
@ -492,22 +492,22 @@ export const mutations = {
const statuses = { const statuses = {
state: defaultState(), state: defaultState(),
actions: { actions: {
addNewStatuses ({ rootState, commit, dispatch, state }, { statuses, showImmediately = false, timeline = false, noIdUpdate = false, userId, pagination }) { addNewStatuses ({ rootState, commit }, { statuses, showImmediately = false, timeline = false, noIdUpdate = false, userId, pagination }) {
commit('addNewStatuses', { statuses, showImmediately, timeline, noIdUpdate, user: rootState.users.currentUser, userId, pagination }) commit('addNewStatuses', { statuses, showImmediately, timeline, noIdUpdate, user: rootState.users.currentUser, userId, pagination })
}, },
fetchStatus ({ rootState, dispatch }, id) { fetchStatus ({ rootState, dispatch }, id) {
return rootState.api.backendInteractor.fetchStatus({ id }) return rootState.api.backendInteractor.fetchStatus({ id })
.then((status) => dispatch('addNewStatuses', { statuses: [status] })) .then((status) => dispatch('addNewStatuses', { statuses: [status] }))
}, },
fetchStatusSource ({ rootState, dispatch }, status) { fetchStatusSource ({ rootState }, status) {
return apiService.fetchStatusSource({ id: status.id, credentials: rootState.users.currentUser.credentials }) return apiService.fetchStatusSource({ id: status.id, credentials: rootState.users.currentUser.credentials })
}, },
fetchStatusHistory ({ rootState, dispatch }, status) { fetchStatusHistory (_, status) {
return apiService.fetchStatusHistory({ status }) return apiService.fetchStatusHistory({ status })
}, },
deleteStatus ({ rootState, commit, dispatch }, status) { deleteStatus ({ rootState, commit }, status) {
apiService.deleteStatus({ id: status.id, credentials: rootState.users.currentUser.credentials }) apiService.deleteStatus({ id: status.id, credentials: rootState.users.currentUser.credentials })
.then((_) => { .then(() => {
commit('setDeleted', { status }) commit('setDeleted', { status })
}) })
.catch((e) => { .catch((e) => {
@ -584,10 +584,10 @@ const statuses = {
commit('setBookmarkedConfirm', { status }) commit('setBookmarkedConfirm', { status })
}) })
}, },
queueFlush ({ rootState, commit }, { timeline, id }) { queueFlush ({ commit }, { timeline, id }) {
commit('queueFlush', { timeline, id }) commit('queueFlush', { timeline, id })
}, },
queueFlushAll ({ rootState, commit }) { queueFlushAll ({ commit }) {
commit('queueFlushAll') commit('queueFlushAll')
}, },
fetchFavsAndRepeats ({ rootState, commit }, id) { fetchFavsAndRepeats ({ rootState, commit }, id) {
@ -605,7 +605,7 @@ const statuses = {
commit('addOwnReaction', { id, emoji, currentUser }) commit('addOwnReaction', { id, emoji, currentUser })
rootState.api.backendInteractor.reactWithEmoji({ id, emoji }).then( rootState.api.backendInteractor.reactWithEmoji({ id, emoji }).then(
ok => { () => {
dispatch('fetchEmojiReactionsBy', id) dispatch('fetchEmojiReactionsBy', id)
} }
) )
@ -616,7 +616,7 @@ const statuses = {
commit('removeOwnReaction', { id, emoji, currentUser }) commit('removeOwnReaction', { id, emoji, currentUser })
rootState.api.backendInteractor.unreactWithEmoji({ id, emoji }).then( rootState.api.backendInteractor.unreactWithEmoji({ id, emoji }).then(
ok => { () => {
dispatch('fetchEmojiReactionsBy', id) dispatch('fetchEmojiReactionsBy', id)
} }
) )

View file

@ -509,8 +509,8 @@ const users = {
const notificationsObject = store.rootState.notifications.idStore const notificationsObject = store.rootState.notifications.idStore
const relevantNotifications = Object.entries(notificationsObject) const relevantNotifications = Object.entries(notificationsObject)
.filter(([k, val]) => notificationIds.includes(k)) .filter(([k]) => notificationIds.includes(k))
.map(([k, val]) => val) .map(([, val]) => val)
// Reconnect users to notifications // Reconnect users to notifications
each(relevantNotifications, (notification) => { each(relevantNotifications, (notification) => {

View file

@ -29,7 +29,7 @@ export const closeDesktopNotification = (rootState, { id }) => {
} }
} }
export const closeAllDesktopNotifications = (rootState) => { export const closeAllDesktopNotifications = () => {
if (!('Notification' in window && window.Notification.permission === 'granted')) return if (!('Notification' in window && window.Notification.permission === 'granted')) return
if (isSWSupported()) { if (isSWSupported()) {

View file

@ -48,7 +48,7 @@ export class RegistrationError extends Error {
} else { } else {
this.message = error this.message = error
} }
} catch (e) { } catch {
// can't parse it, so just treat it like a string // can't parse it, so just treat it like a string
this.message = error this.message = error
} }

View file

@ -42,7 +42,7 @@ export const newImporter = ({
filePicker.addEventListener('change', event => { filePicker.addEventListener('change', event => {
if (event.target.files[0]) { if (event.target.files[0]) {
const filename = event.target.files[0].name const filename = event.target.files[0].name
// eslint-disable-next-line no-undef
const reader = new FileReader() const reader = new FileReader()
reader.onload = ({ target }) => { reader.onload = ({ target }) => {
try { try {

View file

@ -16,7 +16,7 @@ const fetchRelationship = (attempt, userId, store) => new Promise((resolve, reje
} }
}) })
export const requestFollow = (userId, store) => new Promise((resolve, reject) => { export const requestFollow = (userId, store) => new Promise((resolve) => {
store.state.api.backendInteractor.followUser({ id: userId }) store.state.api.backendInteractor.followUser({ id: userId })
.then((updated) => { .then((updated) => {
store.commit('updateUserRelationship', [updated]) store.commit('updateUserRelationship', [updated])
@ -41,7 +41,7 @@ export const requestFollow = (userId, store) => new Promise((resolve, reject) =>
}) })
}) })
export const requestUnfollow = (userId, store) => new Promise((resolve, reject) => { export const requestUnfollow = (userId, store) => new Promise((resolve) => {
store.state.api.backendInteractor.unfollowUser({ id: userId }) store.state.api.backendInteractor.unfollowUser({ id: userId })
.then((updated) => { .then((updated) => {
store.commit('updateUserRelationship', [updated]) store.commit('updateUserRelationship', [updated])

View file

@ -184,7 +184,7 @@ class SwipeAndClickGesture {
} }
} }
click (event) { click () {
if (!this._preventNextClick) { if (!this._preventNextClick) {
this.swipelessClickCallback() this.swipelessClickCallback()
} }

View file

@ -23,7 +23,7 @@ export const getAttrs = (tag, filter) => {
.replace(/\/?$/, '') .replace(/\/?$/, '')
.trim() .trim()
const attrs = Array.from(innertag.matchAll(/([a-z]+[a-z0-9-]*)(?:=("[^"]+?"|'[^']+?'))?/gi)) const attrs = Array.from(innertag.matchAll(/([a-z]+[a-z0-9-]*)(?:=("[^"]+?"|'[^']+?'))?/gi))
.map(([trash, key, value]) => [key, value]) .map(([, key, value]) => [key, value])
.map(([k, v]) => { .map(([k, v]) => {
if (!v) return [k, true] if (!v) return [k, true]
return [k, v.substring(1, v.length - 1)] return [k, v.substring(1, v.length - 1)]

View file

@ -2,7 +2,7 @@ import { useListsStore } from 'src/stores/lists.js'
import apiService from '../api/api.service.js' import apiService from '../api/api.service.js'
import { promiseInterval } from '../promise_interval/promise_interval.js' import { promiseInterval } from '../promise_interval/promise_interval.js'
const fetchAndUpdate = ({ store, credentials }) => { const fetchAndUpdate = ({ credentials }) => {
return apiService.fetchLists({ credentials }) return apiService.fetchLists({ credentials })
.then(lists => { .then(lists => {
useListsStore().setLists(lists) useListsStore().setLists(lists)

View file

@ -48,7 +48,7 @@ const adoptStyleSheets = (styles) => {
export const generateTheme = (inputRuleset, callbacks, debug) => { export const generateTheme = (inputRuleset, callbacks, debug) => {
const { const {
onNewRule = (rule, isLazy) => {}, onNewRule = () => {},
onLazyFinished = () => {}, onLazyFinished = () => {},
onEagerFinished = () => {} onEagerFinished = () => {}
} = callbacks } = callbacks
@ -123,8 +123,8 @@ export const tryLoadCache = async () => {
export const applyTheme = ( export const applyTheme = (
input, input,
onEagerFinish = data => {}, onEagerFinish = () => {},
onFinish = data => {}, onFinish = () => {},
debug debug
) => { ) => {
const eagerStyles = createStyleSheet(EAGER_STYLE_ID) const eagerStyles = createStyleSheet(EAGER_STYLE_ID)
@ -217,7 +217,7 @@ const extractStyleConfig = ({
console.log(defaultState) console.log(defaultState)
const defaultStyleConfig = extractStyleConfig(defaultState) const defaultStyleConfig = extractStyleConfig(defaultState)
export const applyConfig = (input, i18n) => { export const applyConfig = (input) => {
const config = extractStyleConfig(input) const config = extractStyleConfig(input)
if (config === defaultStyleConfig) { if (config === defaultStyleConfig) {
@ -228,7 +228,7 @@ export const applyConfig = (input, i18n) => {
const rules = Object const rules = Object
.entries(config) .entries(config)
.filter(([k, v]) => v) .filter(([, v]) => v)
.map(([k, v]) => `--${k}: ${v}`).join(';') .map(([k, v]) => `--${k}: ${v}`).join(';')
document.getElementById('style-config')?.remove() document.getElementById('style-config')?.remove()
@ -283,7 +283,7 @@ export const getResourcesIndex = async (url, parser = JSON.parse) => {
const builtinData = await window.fetch(url, { cache }) const builtinData = await window.fetch(url, { cache })
const builtinResources = await builtinData.json() const builtinResources = await builtinData.json()
builtin = resourceTransform(builtinResources) builtin = resourceTransform(builtinResources)
} catch (e) { } catch {
builtin = [] builtin = []
console.warn(`Builtin resources at ${url} unavailable`) console.warn(`Builtin resources at ${url} unavailable`)
} }
@ -292,7 +292,7 @@ export const getResourcesIndex = async (url, parser = JSON.parse) => {
const customData = await window.fetch(customUrl, { cache }) const customData = await window.fetch(customUrl, { cache })
const customResources = await customData.json() const customResources = await customData.json()
custom = resourceTransform(customResources) custom = resourceTransform(customResources)
} catch (e) { } catch {
custom = [] custom = []
console.warn(`Custom resources at ${customUrl} unavailable`) console.warn(`Custom resources at ${customUrl} unavailable`)
} }

View file

@ -138,7 +138,7 @@ export function unregisterPushNotifications (token) {
.then((registration) => { .then((registration) => {
return unsubscribePush(registration).then((result) => [registration, result]) return unsubscribePush(registration).then((result) => [registration, result])
}) })
.then(([registration, unsubResult]) => { .then(([, unsubResult]) => {
if (!unsubResult) { if (!unsubResult) {
console.warn('Push subscription cancellation wasn\'t successful') console.warn('Push subscription cancellation wasn\'t successful')
} }

View file

@ -45,7 +45,7 @@ export const deserializeShadow = string => {
} else { } else {
return [mode, result[i]] return [mode, result[i]]
} }
}).filter(([k, v]) => v !== false).slice(1)) }).filter(([, v]) => v !== false).slice(1))
return { x, y, blur, spread, color, alpha, inset, name } return { x, y, blur, spread, color, alpha, inset, name }
} }

View file

@ -1,7 +1,7 @@
import { unroll } from './iss_utils.js' import { unroll } from './iss_utils.js'
import { deserializeShadow } from './iss_deserializer.js' import { deserializeShadow } from './iss_deserializer.js'
export const serializeShadow = (s, throwOnInvalid) => { export const serializeShadow = (s) => {
if (typeof s === 'object') { if (typeof s === 'object') {
const inset = s.inset ? 'inset ' : '' const inset = s.inset ? 'inset ' : ''
const name = s.name ? ` #${s.name} ` : '' const name = s.name ? ` #${s.name} ` : ''

View file

@ -100,7 +100,7 @@ export const genericRuleToSelector = components => (rule, ignoreOutOfTreeSelecto
let arraySelector = Array.isArray(selector) ? selector : [selector] let arraySelector = Array.isArray(selector) ? selector : [selector]
if (ignoreOutOfTreeSelector || liteMode) arraySelector = [arraySelector[0]] if (ignoreOutOfTreeSelector || liteMode) arraySelector = [arraySelector[0]]
arraySelector arraySelector
.sort((a, b) => { .sort((a) => {
if (a.startsWith(':')) return 1 if (a.startsWith(':')) return 1
if (/^[a-z]/.exec(a)) return -1 if (/^[a-z]/.exec(a)) return -1
else return 0 else return 0

View file

@ -131,7 +131,7 @@ export const shadowFunctions = {
'[alpha]: (Optional) border opacity, defaults to 1 (fully opaque)', '[alpha]: (Optional) border opacity, defaults to 1 (fully opaque)',
'[inset]: (Optional) whether border should be on the inside or outside, defaults to inside' '[inset]: (Optional) whether border should be on the inside or outside, defaults to inside'
], ],
exec: (args, { findColor }) => { exec: (args) => {
const [color, side, alpha = '1', widthArg = '1', inset = 'inset'] = args const [color, side, alpha = '1', widthArg = '1', inset = 'inset'] = args
const width = Number(widthArg) const width = Number(widthArg)

Some files were not shown because too many files have changed in this diff Show more