fix(ui): generate only one thread composer in PublishWidgetList
and provide it to each widget (#2953)
This commit is contained in:
parent
dbf743afd9
commit
4061075dde
2 changed files with 6 additions and 4 deletions
|
@ -20,9 +20,8 @@ const {
|
|||
dialogLabelledBy?: string
|
||||
}>()
|
||||
|
||||
const threadItems = computed(() =>
|
||||
useThreadComposer(draftKey, initial).threadItems.value,
|
||||
)
|
||||
const threadComposer = useThreadComposer(draftKey, initial)
|
||||
const threadItems = computed(() => threadComposer.threadItems.value)
|
||||
|
||||
onDeactivated(() => {
|
||||
clearEmptyDrafts()
|
||||
|
@ -38,6 +37,7 @@ function isFirstItem(index: number) {
|
|||
<PublishWidget
|
||||
v-for="(_, index) in threadItems" :key="`${draftKey}-${index}`"
|
||||
v-bind="$attrs"
|
||||
:thread-composer="threadComposer"
|
||||
:draft-key="draftKey"
|
||||
:draft-item-index="index"
|
||||
:expanded="isFirstItem(index) ? expanded : true"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue