Merge branch 'virtual-scrolling-2.0' into shigusegubu-themes3

This commit is contained in:
Henry Jameson 2026-09-16 21:43:55 +03:00
commit fefd4e224a
3 changed files with 17 additions and 18 deletions

View file

@ -164,7 +164,7 @@ export default {
const resizeObserver = ref(new ResizeObserver(updateVirtualHeight)) const resizeObserver = ref(new ResizeObserver(updateVirtualHeight))
watch(rootElement, () => resizeObserver.value.observe(rootElement.value)) watch(rootElement, () => resizeObserver.value.observe(rootElement.value))
watch(suspendable, (value) => watch(suspendable, (value) =>
emit('suspendableStateChange', { suspend: value, id: statusId.value }), emit('suspendableStateChange', { suspendable: value, id: statusId.value }),
) )
onUnmounted(() => resizeObserver.value.disconnect()) onUnmounted(() => resizeObserver.value.disconnect())
@ -215,8 +215,8 @@ export default {
}) })
const changeSuspendStateLinearLocal = (e) => { const changeSuspendStateLinearLocal = (e) => {
changeSuspendStateLinear(e) changeSuspendStateLinear(e)
const { id, suspend } = e const { id, suspendable } = e
if (suspend) { if (suspendable) {
unsuspendableIds.value.delete(id) unsuspendableIds.value.delete(id)
} else { } else {
unsuspendableIds.value.add(id) unsuspendableIds.value.add(id)
@ -266,20 +266,19 @@ export default {
}) })
const changeSuspendStateAncestorsLocal = (e) => { const changeSuspendStateAncestorsLocal = (e) => {
changeSuspendStateAncestors(e) changeSuspendStateAncestors(e)
const { id, suspend } = e const { id, suspendable } = e
if (suspend) { if (suspendable) {
unsuspendableIds.value.add(id)
} else {
unsuspendableIds.value.delete(id) unsuspendableIds.value.delete(id)
} else {
unsuspendableIds.value.add(id)
} }
} }
const changeSuspendStateCurrentLevelLocal = (e) => { const changeSuspendStateCurrentLevelLocal = (e) => {
changeSuspendStateLinear(e) const { id, suspendable } = e
const { id, suspend } = e if (suspendable) {
if (suspend) {
unsuspendableIds.value.add(id)
} else {
unsuspendableIds.value.delete(id) unsuspendableIds.value.delete(id)
} else {
unsuspendableIds.value.add(id)
} }
} }

View file

@ -634,8 +634,8 @@ const Status = {
useStatusesStore().fetchFavs(this.mainStatus.id) useStatusesStore().fetchFavs(this.mainStatus.id)
} }
}, },
isSuspendable: function (suspend) { isSuspendable: function (suspendable) {
this.$emit('suspendableStateChange', { id: this.status.id, suspend }) this.$emit('suspendableStateChange', { id: this.status.id, suspendable })
}, },
}, },
} }

View file

@ -35,11 +35,11 @@ export function useVirtualScrolling({
}) { }) {
// # Suspension // # Suspension
const unsuspendibleIds = ref(new Set()) const unsuspendibleIds = ref(new Set())
const changeSuspendState = ({ id, suspend }) => { const changeSuspendState = ({ id, suspendable }) => {
if (!suspend) { if (suspendable) {
unsuspendibleIds.value.add(id)
} else {
unsuspendibleIds.value.delete(id) unsuspendibleIds.value.delete(id)
} else {
unsuspendibleIds.value.add(id)
} }
} }