summaryrefslogtreecommitdiff
path: root/src/models/note.ts
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2018-05-14 09:01:37 +0900
committersyuilo <syuilotan@yahoo.co.jp>2018-05-14 09:01:37 +0900
commit9f4624283dbaf0ed9bde8ee8ac6db287dbba15ed (patch)
treeb87df0879eb2976ae124486bbb305bb061fd2ef9 /src/models/note.ts
parentFix bug (diff)
downloadsharkey-9f4624283dbaf0ed9bde8ee8ac6db287dbba15ed.tar.gz
sharkey-9f4624283dbaf0ed9bde8ee8ac6db287dbba15ed.tar.bz2
sharkey-9f4624283dbaf0ed9bde8ee8ac6db287dbba15ed.zip
Disable prev/next
Diffstat (limited to 'src/models/note.ts')
-rw-r--r--src/models/note.ts39
1 files changed, 4 insertions, 35 deletions
diff --git a/src/models/note.ts b/src/models/note.ts
index b2b93453e6..337711bcfa 100644
--- a/src/models/note.ts
+++ b/src/models/note.ts
@@ -271,41 +271,10 @@ export const pack = async (
// When requested a detailed note data
if (opts.detail) {
- // Get previous note info
- _note.prev = (async () => {
- const prev = await Note.findOne({
- userId: _note.userId,
- _id: {
- $lt: id
- }
- }, {
- fields: {
- _id: true
- },
- sort: {
- _id: -1
- }
- });
- return prev ? prev._id.toHexString() : null;
- })();
-
- // Get next note info
- _note.next = (async () => {
- const next = await Note.findOne({
- userId: _note.userId,
- _id: {
- $gt: id
- }
- }, {
- fields: {
- _id: true
- },
- sort: {
- _id: 1
- }
- });
- return next ? next._id.toHexString() : null;
- })();
+ //#region 重いので廃止
+ _note.prev = null;
+ _note.next = null;
+ //#endregion
if (_note.replyId) {
// Populate reply to note