biome format --write

This commit is contained in:
Henry Jameson 2026-01-06 16:22:52 +02:00
commit 9262e803ec
415 changed files with 54076 additions and 17419 deletions

View file

@ -6,13 +6,9 @@ import Gallery from 'src/components/gallery/gallery.vue'
import { cloneDeep } from 'lodash'
import { library } from '@fortawesome/fontawesome-svg-core'
import {
faPollH
} from '@fortawesome/free-solid-svg-icons'
import { faPollH } from '@fortawesome/free-solid-svg-icons'
library.add(
faPollH
)
library.add(faPollH)
const Draft = {
components: {
@ -20,23 +16,23 @@ const Draft = {
EditStatusForm,
ConfirmModal,
StatusContent,
Gallery
Gallery,
},
props: {
draft: {
type: Object,
required: true
}
required: true,
},
},
data () {
data() {
return {
referenceDraft: cloneDeep(this.draft),
editing: false,
showingConfirmDialog: false
showingConfirmDialog: false,
}
},
computed: {
relAttrs () {
relAttrs() {
if (this.draft.type === 'edit') {
return { statusId: this.draft.refId }
} else if (this.draft.type === 'reply') {
@ -45,24 +41,24 @@ const Draft = {
return {}
}
},
safeToSave () {
return this.draft.status ||
this.draft.files?.length ||
this.draft.hasPoll
safeToSave() {
return this.draft.status || this.draft.files?.length || this.draft.hasPoll
},
postStatusFormProps () {
postStatusFormProps() {
return {
draftId: this.draft.id,
...this.relAttrs
...this.relAttrs,
}
},
refStatus () {
return this.draft.refId ? this.$store.state.statuses.allStatusesObject[this.draft.refId] : undefined
refStatus() {
return this.draft.refId
? this.$store.state.statuses.allStatusesObject[this.draft.refId]
: undefined
},
localCollapseSubjectDefault () {
localCollapseSubjectDefault() {
return this.$store.getters.mergedConfig.collapseMessageWithSubject
},
nsfwClickthrough () {
nsfwClickthrough() {
if (!this.draft.nsfw) {
return false
}
@ -70,35 +66,34 @@ const Draft = {
return false
}
return true
}
},
},
watch: {
editing (newVal) {
editing(newVal) {
if (newVal) return
if (this.safeToSave) {
this.$store.dispatch('addOrSaveDraft', { draft: this.draft })
} else {
this.$store.dispatch('addOrSaveDraft', { draft: this.referenceDraft })
}
}
},
},
methods: {
toggleEditing () {
toggleEditing() {
this.editing = !this.editing
},
abandon () {
abandon() {
this.showingConfirmDialog = true
},
doAbandon () {
this.$store.dispatch('abandonDraft', { id: this.draft.id })
.then(() => {
this.hideConfirmDialog()
})
doAbandon() {
this.$store.dispatch('abandonDraft', { id: this.draft.id }).then(() => {
this.hideConfirmDialog()
})
},
hideConfirmDialog () {
hideConfirmDialog() {
this.showingConfirmDialog = false
}
}
},
},
}
export default Draft