diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2022-02-25 20:03:17 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2022-02-25 20:03:17 +0900 |
| commit | f003289816fac4ba7d0b4b8e343645f684243dd0 (patch) | |
| tree | 1eaf37315e3d8e57517ade91754122e7d518c5f4 | |
| parent | refactor(client): use setup (diff) | |
| download | sharkey-f003289816fac4ba7d0b4b8e343645f684243dd0.tar.gz sharkey-f003289816fac4ba7d0b4b8e343645f684243dd0.tar.bz2 sharkey-f003289816fac4ba7d0b4b8e343645f684243dd0.zip | |
refactor
| -rw-r--r-- | packages/backend/src/models/repositories/note.ts | 6 | ||||
| -rw-r--r-- | packages/client/src/pages/note.vue | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/packages/backend/src/models/repositories/note.ts b/packages/backend/src/models/repositories/note.ts index a7e44d9496..4d6a6d22f8 100644 --- a/packages/backend/src/models/repositories/note.ts +++ b/packages/backend/src/models/repositories/note.ts @@ -202,8 +202,8 @@ export class NoteRepository extends Repository<Note> { let text = note.text; - if (note.name && (note.url || note.uri)) { - text = `【${note.name}】\n${(note.text || '').trim()}\n\n${note.url || note.uri}`; + if (note.name && (note.url ?? note.uri)) { + text = `【${note.name}】\n${(note.text || '').trim()}\n\n${note.url ?? note.uri}`; } const channel = note.channelId @@ -218,7 +218,7 @@ export class NoteRepository extends Repository<Note> { id: note.id, createdAt: note.createdAt.toISOString(), userId: note.userId, - user: Users.pack(note.user || note.userId, me, { + user: Users.pack(note.user ?? note.userId, me, { detail: false, }), text: text, diff --git a/packages/client/src/pages/note.vue b/packages/client/src/pages/note.vue index efeea345dc..29261ec484 100644 --- a/packages/client/src/pages/note.vue +++ b/packages/client/src/pages/note.vue @@ -10,7 +10,7 @@ <div class="main _gap"> <MkButton v-if="!showNext && hasNext" class="load next" @click="showNext = true"><i class="fas fa-chevron-up"></i></MkButton> <div class="note _gap"> - <MkRemoteCaution v-if="note.user.host != null" :href="note.url || note.uri" class="_isolated"/> + <MkRemoteCaution v-if="note.user.host != null" :href="note.url ?? note.uri" class="_isolated"/> <XNoteDetailed :key="note.id" v-model:note="note" class="_isolated note"/> </div> <div v-if="clips && clips.length > 0" class="_content clips _gap"> |