Merge branch 'vue3-again' into shigusegubu-vue3

* vue3-again:
  fix forms closing in timelines
  fix minor renames
  woah ima stupid
This commit is contained in:
Henry Jameson 2022-03-24 14:09:45 +02:00
commit 12c8093ac2
5 changed files with 31 additions and 29 deletions

View file

@ -6,7 +6,7 @@
<input <input
type="checkbox" type="checkbox"
:disabled="disabled" :disabled="disabled"
:modelValue="modelValue" :checked="modelValue"
:indeterminate="indeterminate" :indeterminate="indeterminate"
@change="$emit('update:modelValue', $event.target.checked)" @change="$emit('update:modelValue', $event.target.checked)"
> >

View file

@ -66,7 +66,7 @@ const ImageCropper = {
} }
}, },
methods: { methods: {
destroy () { unmounted () {
if (this.cropper) { if (this.cropper) {
this.cropper.destroy() this.cropper.destroy()
} }
@ -117,7 +117,7 @@ const ImageCropper = {
const fileInput = this.$refs.input const fileInput = this.$refs.input
fileInput.addEventListener('change', this.readFile) fileInput.addEventListener('change', this.readFile)
}, },
beforeDestroy: function () { beforeUnmount: function () {
// remove the event listeners // remove the event listeners
const trigger = this.getTriggerDOM() const trigger = this.getTriggerDOM()
if (trigger) { if (trigger) {

View file

@ -40,6 +40,12 @@ const Timeline = {
TimelineQuickSettings TimelineQuickSettings
}, },
computed: { computed: {
filteredVisibleStatuses () {
return this.timeline.visibleStatuses.filter(status => this.timelineName !== 'user' || (status.id >= this.timeline.minId && status.id <= this.timeline.maxId))
},
filteredPinnedStatusesId () {
return this.pinnedStatusIds.filter(statusId => this.timeline.statusesObject[statusId])
},
newStatusCount () { newStatusCount () {
return this.timeline.newStatusCount return this.timeline.newStatusCount
}, },

View file

@ -23,30 +23,26 @@
ref="timeline" ref="timeline"
class="timeline" class="timeline"
> >
<template v-for="statusId in pinnedStatusIds"> <conversation
<conversation v-for="statusId in filteredPinnedStatusIds"
v-if="timeline.statusesObject[statusId]" :key="statusId + '-pinned'"
:key="statusId + '-pinned'" class="status-fadein"
class="status-fadein" :status-id="statusId"
:status-id="statusId" :collapsable="true"
:collapsable="true" :pinned-status-ids-object="pinnedStatusIdsObject"
:pinned-status-ids-object="pinnedStatusIdsObject" :in-profile="inProfile"
:in-profile="inProfile" :profile-user-id="userId"
:profile-user-id="userId" />
/> <conversation
</template> v-for="status in filteredVisibleStatuses"
<template v-for="status in timeline.visibleStatuses"> :key="status.id"
<conversation class="status-fadein"
v-if="timelineName !== 'user' || (status.id >= timeline.minId && status.id <= timeline.maxId)" :status-id="status.id"
:key="status.id" :collapsable="true"
class="status-fadein" :in-profile="inProfile"
:status-id="status.id" :profile-user-id="userId"
:collapsable="true" :virtual-hidden="virtualScrollingEnabled && !statusesToDisplay.includes(status.id)"
:in-profile="inProfile" />
:profile-user-id="userId"
:virtual-hidden="virtualScrollingEnabled && !statusesToDisplay.includes(status.id)"
/>
</template>
</div> </div>
</div> </div>
<div :class="classes.footer"> <div :class="classes.footer">

View file

@ -17,7 +17,7 @@ library.add(
const withLoadMore = ({ const withLoadMore = ({
fetch, // function to fetch entries and return a promise fetch, // function to fetch entries and return a promise
select, // function to select data from store select, // function to select data from store
destroy, // function called at "destroyed" lifecycle unmounted, // function called at "destroyed" lifecycle
childPropName = 'entries', // name of the prop to be passed into the wrapped component childPropName = 'entries', // name of the prop to be passed into the wrapped component
additionalPropNames = [] // additional prop name list of the wrapper component additionalPropNames = [] // additional prop name list of the wrapper component
}) => (WrappedComponent) => { }) => (WrappedComponent) => {
@ -42,7 +42,7 @@ const withLoadMore = ({
}, },
unmounted () { unmounted () {
window.removeEventListener('scroll', this.scrollLoad) window.removeEventListener('scroll', this.scrollLoad)
destroy && destroy(this.$props, this.$store) unmounted && unmounted(this.$props, this.$store)
}, },
methods: { methods: {
// Entries is not a computed because computed can't track the dynamic // Entries is not a computed because computed can't track the dynamic