fix: ノート詳細ページの新しいノートを表示する機能の動作が正しくなるように修正する (#8607)

* ノート詳細で新しいノートの表示が正しくないのを修正する

* ノート詳細から別のノート詳細を表示した時に前後の表示をリセットする
This commit is contained in:
xianon 2022-05-19 20:32:55 +09:00 committed by GitHub
parent 3abb0d589d
commit 0f33864df1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 2 deletions

View File

@ -14,8 +14,14 @@
</div> </div>
<div v-else ref="rootEl"> <div v-else ref="rootEl">
<div v-show="pagination.reversed && more" key="_more_" class="cxiknjgy _gap">
<MkButton v-if="!moreFetching" class="button" :disabled="moreFetching" :style="{ cursor: moreFetching ? 'wait' : 'pointer' }" primary @click="fetchMoreAhead">
{{ $ts.loadMore }}
</MkButton>
<MkLoading v-else class="loading"/>
</div>
<slot :items="items"></slot> <slot :items="items"></slot>
<div v-show="more" key="_more_" class="cxiknjgy _gap"> <div v-show="!pagination.reversed && more" key="_more_" class="cxiknjgy _gap">
<MkButton v-if="!moreFetching" v-appear="($store.state.enableInfiniteScroll && !disableAutoLoad) ? fetchMore : null" class="button" :disabled="moreFetching" :style="{ cursor: moreFetching ? 'wait' : 'pointer' }" primary @click="fetchMore"> <MkButton v-if="!moreFetching" v-appear="($store.state.enableInfiniteScroll && !disableAutoLoad) ? fetchMore : null" class="button" :disabled="moreFetching" :style="{ cursor: moreFetching ? 'wait' : 'pointer' }" primary @click="fetchMore">
{{ $ts.loadMore }} {{ $ts.loadMore }}
</MkButton> </MkButton>
@ -278,7 +284,6 @@ defineExpose({
queue, queue,
backed, backed,
reload, reload,
fetchMoreAhead,
prepend, prepend,
append, append,
removeItem, removeItem,

View File

@ -108,6 +108,10 @@ export default defineComponent({
}, },
methods: { methods: {
fetch() { fetch() {
this.hasPrev = false;
this.hasNext = false;
this.showPrev = false;
this.showNext = false;
this.note = null; this.note = null;
os.api('notes/show', { os.api('notes/show', {
noteId: this.noteId noteId: this.noteId