From 271d3483b2196a56b874db1ab391f088db499021 Mon Sep 17 00:00:00 2001 From: mattyatea Date: Sun, 8 Oct 2023 00:25:33 +0900 Subject: [PATCH] bug fix --- package.json | 2 +- .../src/server/api/endpoints/users/notes.ts | 15 ++--- packages/frontend/src/pages/timeline.vue | 2 +- packages/frontend/src/store.ts | 4 +- pnpm-lock.yaml | 58 ++++++++++++++++++- 5 files changed, 64 insertions(+), 17 deletions(-) diff --git a/package.json b/package.json index 1adac4764b..94a7198d5d 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "build-assets": "node ./scripts/build-assets.mjs", "build": "pnpm build-pre && pnpm -r build && pnpm build-assets", "build-storybook": "pnpm --filter frontend build-storybook", - "build-and-start": "pnpm build && pnpm start", + "build-and-start": "pnpm i && pnpm build && pnpm start", "start": "pnpm check:connect && cd packages/backend && node ./built/boot/entry.js", "start:test": "cd packages/backend && cross-env NODE_ENV=test node ./built/boot/entry.js", "init": "pnpm migrate", diff --git a/packages/backend/src/server/api/endpoints/users/notes.ts b/packages/backend/src/server/api/endpoints/users/notes.ts index 5ba0610f88..73c066c6e8 100644 --- a/packages/backend/src/server/api/endpoints/users/notes.ts +++ b/packages/backend/src/server/api/endpoints/users/notes.ts @@ -13,9 +13,9 @@ import { DI } from '@/di-symbols.js'; import { CacheService } from '@/core/CacheService.js'; import { IdService } from '@/core/IdService.js'; import { isUserRelated } from '@/misc/is-user-related.js'; -import { QueryService } from '@/server/api/QueryService.js'; +import { QueryService } from '@/core/QueryService.js'; import { ApiError } from '../../error.js'; -import { GetterService } from '@/core/GetterService.js' +import { GetterService } from '@/server/api/GetterService.js' export const meta = { tags: ['users', 'notes'], @@ -118,15 +118,10 @@ export default class extends Endpoint { // eslint- noteIds = noteIds.slice(0, ps.limit); if (noteIds.length < limit) { - // Lookup user - const user = await this.getterService.getUser(ps.userId).catch(err => { - if (err.id === '15348ddd-432d-49c2-8a5a-8069753becff') throw new ApiError(meta.errors.noSuchUser); - throw err; - }); //#region Construct query const query = this.queryService.makePaginationQuery(this.notesRepository.createQueryBuilder('note'), ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate) - .andWhere('note.userId = :userId', { userId: user.id }) + .andWhere('note.userId = :userId', { userId: ps.userId }) .innerJoinAndSelect('note.user', 'user') .leftJoinAndSelect('note.reply', 'reply') .leftJoinAndSelect('note.renote', 'renote') @@ -141,7 +136,7 @@ export default class extends Endpoint { // eslint- this.queryService.generateVisibilityQuery(query, me); if (me) { - this.queryService.generateMutedUserQuery(query, me, user); + this.queryService.generateMutedUserQuery(query, me); this.queryService.generateBlockedUserQuery(query, me); } @@ -165,7 +160,7 @@ export default class extends Endpoint { // eslint- if (ps.includeMyRenotes === false) { query.andWhere(new Brackets(qb => { - qb.orWhere('note.userId != :userId', { userId: user.id }); + qb.orWhere('note.userId != :userId', { userId: ps.userId }); qb.orWhere('note.renoteId IS NULL'); qb.orWhere('note.text IS NOT NULL'); qb.orWhere('note.fileIds != \'{}\''); diff --git a/packages/frontend/src/pages/timeline.vue b/packages/frontend/src/pages/timeline.vue index 179ab63f41..fbb61d7bb8 100644 --- a/packages/frontend/src/pages/timeline.vue +++ b/packages/frontend/src/pages/timeline.vue @@ -65,7 +65,7 @@ const withReplies_store = computed(defaultStore.makeGetterSetter('withRenotes') const withRenotes_store = computed(defaultStore.makeGetterSetter('withReplies')) const onlyFiles_store = computed(defaultStore.makeGetterSetter('onlyFiles')) const withRenotes = $ref(defaultStore.state.onlyAndWithSave ? withRenotes_store : true); -const withReplies = $ref(defaultStore.state.onlyAndWithSave ? withReplies_store : false); +const withReplies = $ref(defaultStore.state.onlyAndWithSave ? withReplies_store : true); const onlyFiles = $ref(defaultStore.state.onlyAndWithSave ? onlyFiles_store : false); const isShowMediaTimeline = $ref(defaultStore.state.showMediaTimeline) watch($$(src), () => queue = 0); diff --git a/packages/frontend/src/store.ts b/packages/frontend/src/store.ts index b2d3c610ab..eb7def7762 100644 --- a/packages/frontend/src/store.ts +++ b/packages/frontend/src/store.ts @@ -362,7 +362,7 @@ export const defaultStore = markRaw(new Storage('base', { }, onlyAndWithSave:{ where: 'device', - default: true, + default: false, }, onlyFiles:{ where: 'device', @@ -370,7 +370,7 @@ export const defaultStore = markRaw(new Storage('base', { }, withReplies:{ where: 'device', - default: false, + default: true, }, withRenotes:{ where: 'device', diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 49ac89d59c..0e5dbf8438 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -814,6 +814,9 @@ importers: vue: specifier: 3.3.4 version: 3.3.4 + vue-multiselect: + specifier: ^2.1.7 + version: 2.1.7 vue-prism-editor: specifier: 2.0.0-alpha.2 version: 2.0.0-alpha.2(vue@3.3.4) @@ -6906,7 +6909,7 @@ packages: ts-dedent: 2.2.0 type-fest: 2.19.0 vue: 3.3.4 - vue-component-type-helpers: 1.8.15 + vue-component-type-helpers: 1.8.16 transitivePeerDependencies: - encoding - supports-color @@ -7972,6 +7975,10 @@ packages: '@types/node': 20.8.2 dev: true + /@types/web-bluetooth@0.0.18: + resolution: {integrity: sha512-v/ZHEj9xh82usl8LMR3GarzFY1IrbXJw5L4QfQhokjRV91q+SelFqxQWSep1ucXEZ22+dSTwLFkXeur25sPIbw==} + dev: false + /@types/web-push@3.6.1: resolution: {integrity: sha512-Zu6Iju7c4IlE8I8eEeFLYRb7XFqvHFmWWAYr1cmug9EX3c6CDarxIXWN/GO0sxjbJLkHPwozUzp6cLdXsrq7Ew==} dependencies: @@ -8403,6 +8410,31 @@ packages: - typescript dev: true + /@vueuse/core@10.5.0(vue@3.3.4): + resolution: {integrity: sha512-z/tI2eSvxwLRjOhDm0h/SXAjNm8N5ld6/SC/JQs6o6kpJ6Ya50LnEL8g5hoYu005i28L0zqB5L5yAl8Jl26K3A==} + dependencies: + '@types/web-bluetooth': 0.0.18 + '@vueuse/metadata': 10.5.0 + '@vueuse/shared': 10.5.0(vue@3.3.4) + vue-demi: 0.14.6(vue@3.3.4) + transitivePeerDependencies: + - '@vue/composition-api' + - vue + dev: false + + /@vueuse/metadata@10.5.0: + resolution: {integrity: sha512-fEbElR+MaIYyCkeM0SzWkdoMtOpIwO72x8WsZHRE7IggiOlILttqttM69AS13nrDxosnDBYdyy3C5mR1LCxHsw==} + dev: false + + /@vueuse/shared@10.5.0(vue@3.3.4): + resolution: {integrity: sha512-18iyxbbHYLst9MqU1X1QNdMHIjks6wC7XTVf0KNOv5es/Ms6gjVFCAAWTVP2JStuGqydg3DT+ExpFORUEi9yhg==} + dependencies: + vue-demi: 0.14.6(vue@3.3.4) + transitivePeerDependencies: + - '@vue/composition-api' + - vue + dev: false + /@webgpu/types@0.1.30: resolution: {integrity: sha512-9AXJSmL3MzY8ZL//JjudA//q+2kBRGhLBFpkdGksWIuxrMy81nFrCzj2Am+mbh8WoU6rXmv7cY5E3rdlyru2Qg==} requiresBuild: true @@ -19173,8 +19205,8 @@ packages: resolution: {integrity: sha512-Dhxzh5HZuiHQhbvTW9AMetFfBHDMYpo23Uo9btPXgdYP+3T5S+p+jgNy7spra+veYhBP2dCSgxR/i2Y02h5/6w==} engines: {node: '>=0.10.0'} - /vue-component-type-helpers@1.8.15: - resolution: {integrity: sha512-RKiPRKW4BdwgmQ9vaNkHYKAThdTbgU4TOphVyyzqxRwsOJOoRIrb+vB49XLvs5CKPNrvxMXZMwPe5FyJCqFWyg==} + /vue-component-type-helpers@1.8.16: + resolution: {integrity: sha512-Pbm1/OyJ1m+8TnMApwHu9+WFqju756rdjdhd9TxldkbjmD5baVXVE3UnCqGa/qlEqUxqgi6zC7I5OKNUI8inGQ==} dev: true /vue-demi@0.13.11(vue@3.3.4): @@ -19192,6 +19224,21 @@ packages: vue: 3.3.4 dev: false + /vue-demi@0.14.6(vue@3.3.4): + resolution: {integrity: sha512-8QA7wrYSHKaYgUxDA5ZC24w+eHm3sYCbp0EzcDwKqN3p6HqtTCGR/GVsPyZW92unff4UlcSh++lmqDWN3ZIq4w==} + engines: {node: '>=12'} + hasBin: true + requiresBuild: true + peerDependencies: + '@vue/composition-api': ^1.0.0-rc.1 + vue: ^3.0.0-0 || ^2.6.0 + peerDependenciesMeta: + '@vue/composition-api': + optional: true + dependencies: + vue: 3.3.4 + dev: false + /vue-docgen-api@4.64.1(vue@3.3.4): resolution: {integrity: sha512-jbOf7ByE3Zvtuk+429Jorl+eIeh2aB2Fx1GUo3xJd1aByJWE8KDlSEa6b11PB1ze8f0sRUBraRDinICCk0KY7g==} dependencies: @@ -19236,6 +19283,11 @@ packages: vue: 3.3.4 dev: true + /vue-multiselect@2.1.7: + resolution: {integrity: sha512-KIegcN+Ntwg3cbkY/jhw2s/+XJUM0Lpi/LcKFYCS8PrZHcWBl2iKCVze7ZCnRj3w8H7/lUJ9v7rj9KQiNxApBw==} + engines: {node: '>= 4.0.0', npm: '>= 3.0.0'} + dev: false + /vue-prism-editor@2.0.0-alpha.2(vue@3.3.4): resolution: {integrity: sha512-Gu42ba9nosrE+gJpnAEuEkDMqG9zSUysIR8SdXUw8MQKDjBnnNR9lHC18uOr/ICz7yrA/5c7jHJr9lpElODC7w==} engines: {node: '>=10'}