mirror of
https://iceshrimp.dev/crimekillz/trashposs
synced 2024-11-25 10:19:06 +01:00
Remove load more buttons on note view, resolves #139
This commit is contained in:
parent
d976fb0329
commit
d80164723a
@ -14,23 +14,7 @@
|
|||||||
mode="out-in"
|
mode="out-in"
|
||||||
>
|
>
|
||||||
<div v-if="appearNote" class="note">
|
<div v-if="appearNote" class="note">
|
||||||
<div v-if="showNext" class="_gap">
|
|
||||||
<XNotes
|
|
||||||
class="_content"
|
|
||||||
:pagination="nextPagination"
|
|
||||||
:no-gap="true"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="main _gap">
|
<div class="main _gap">
|
||||||
<MkButton
|
|
||||||
v-if="!showNext && hasNext"
|
|
||||||
class="load next"
|
|
||||||
@click="showNext = true"
|
|
||||||
>
|
|
||||||
<i class="ph-caret-up ph-bold ph-lg"></i>
|
|
||||||
{{ `${i18n.ts.loadMore} (${i18n.ts.newer})` }}
|
|
||||||
</MkButton>
|
|
||||||
<div class="note _gap">
|
<div class="note _gap">
|
||||||
<MkRemoteCaution
|
<MkRemoteCaution
|
||||||
v-if="appearNote.user.host != null"
|
v-if="appearNote.user.host != null"
|
||||||
@ -43,22 +27,6 @@
|
|||||||
class="note"
|
class="note"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<MkButton
|
|
||||||
v-if="!showPrev && hasPrev"
|
|
||||||
class="load prev"
|
|
||||||
@click="showPrev = true"
|
|
||||||
>
|
|
||||||
<i class="ph-caret-down ph-bold ph-lg"></i>
|
|
||||||
{{ `${i18n.ts.loadMore} (${i18n.ts.older})` }}
|
|
||||||
</MkButton>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div v-if="showPrev" class="_gap">
|
|
||||||
<XNotes
|
|
||||||
class="_content"
|
|
||||||
:pagination="prevPagination"
|
|
||||||
:no-gap="true"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<MkError v-else-if="error" @retry="fetch()" />
|
<MkError v-else-if="error" @retry="fetch()" />
|
||||||
@ -85,10 +53,6 @@ const props = defineProps<{
|
|||||||
}>();
|
}>();
|
||||||
|
|
||||||
let note = $ref<null | misskey.entities.Note>();
|
let note = $ref<null | misskey.entities.Note>();
|
||||||
let hasPrev = $ref(false);
|
|
||||||
let hasNext = $ref(false);
|
|
||||||
let showPrev = $ref(false);
|
|
||||||
let showNext = $ref(false);
|
|
||||||
let error = $ref();
|
let error = $ref();
|
||||||
let isRenote = $ref(false);
|
let isRenote = $ref(false);
|
||||||
let appearNote = $ref<null | misskey.entities.Note>();
|
let appearNote = $ref<null | misskey.entities.Note>();
|
||||||
@ -122,10 +86,6 @@ const nextPagination = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
function fetchNote() {
|
function fetchNote() {
|
||||||
hasPrev = false;
|
|
||||||
hasNext = false;
|
|
||||||
showPrev = false;
|
|
||||||
showNext = false;
|
|
||||||
note = null;
|
note = null;
|
||||||
os.api("notes/show", {
|
os.api("notes/show", {
|
||||||
noteId: props.noteId,
|
noteId: props.noteId,
|
||||||
@ -140,22 +100,6 @@ function fetchNote() {
|
|||||||
appearNote = isRenote
|
appearNote = isRenote
|
||||||
? (note.renote as misskey.entities.Note)
|
? (note.renote as misskey.entities.Note)
|
||||||
: note;
|
: note;
|
||||||
|
|
||||||
Promise.all([
|
|
||||||
os.api("users/notes", {
|
|
||||||
userId: note.userId,
|
|
||||||
untilId: note.id,
|
|
||||||
limit: 1,
|
|
||||||
}),
|
|
||||||
os.api("users/notes", {
|
|
||||||
userId: note.userId,
|
|
||||||
sinceId: note.id,
|
|
||||||
limit: 1,
|
|
||||||
}),
|
|
||||||
]).then(([prev, next]) => {
|
|
||||||
hasPrev = prev.length !== 0;
|
|
||||||
hasNext = next.length !== 0;
|
|
||||||
});
|
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
error = err;
|
error = err;
|
||||||
|
Loading…
Reference in New Issue
Block a user