backedがfalseになったら通知を既読にする
This commit is contained in:
parent
7ccdd503b7
commit
d6e57059e4
2 changed files with 9 additions and 2 deletions
|
@ -17,7 +17,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { onUnmounted, onMounted, computed, shallowRef } from 'vue';
|
import { onUnmounted, onMounted, computed, shallowRef, watch } from 'vue';
|
||||||
import MkPagination, { Paging } from '@/components/MkPagination.vue';
|
import MkPagination, { Paging } from '@/components/MkPagination.vue';
|
||||||
import XNotification from '@/components/MkNotification.vue';
|
import XNotification from '@/components/MkNotification.vue';
|
||||||
import MkDateSeparatedList from '@/components/MkDateSeparatedList.vue';
|
import MkDateSeparatedList from '@/components/MkDateSeparatedList.vue';
|
||||||
|
@ -50,10 +50,16 @@ const onNotification = (notification) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isMuted) {
|
if (!isMuted) {
|
||||||
pagingComponent.value.prepend(notification);
|
pagingComponent.value?.prepend(notification);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
watch(() => pagingComponent.value?.backed, (backed) => {
|
||||||
|
if (backed === false) {
|
||||||
|
useStream().send('readNotification');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
let connection;
|
let connection;
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
|
|
@ -568,6 +568,7 @@ defineExpose({
|
||||||
more,
|
more,
|
||||||
inited,
|
inited,
|
||||||
queueSize,
|
queueSize,
|
||||||
|
backed: $$(backed),
|
||||||
reload,
|
reload,
|
||||||
prepend,
|
prepend,
|
||||||
append: appendItem,
|
append: appendItem,
|
||||||
|
|
Loading…
Reference in a new issue