summaryrefslogtreecommitdiff
path: root/packages/misskey-js/src/note.ts
diff options
context:
space:
mode:
authorかっこかり <67428053+kakkokari-gtyih@users.noreply.github.com>2024-08-17 11:28:22 +0900
committerGitHub <noreply@github.com>2024-08-17 11:28:22 +0900
commit059eb6d379cc84ee48c76bcea88dd90423f4f929 (patch)
tree484f0274242d7013e6feaa6e5860f11e3d00ede6 /packages/misskey-js/src/note.ts
parentNew Crowdin updates (#14393) (diff)
downloadmisskey-059eb6d379cc84ee48c76bcea88dd90423f4f929.tar.gz
misskey-059eb6d379cc84ee48c76bcea88dd90423f4f929.tar.bz2
misskey-059eb6d379cc84ee48c76bcea88dd90423f4f929.zip
fix(frontend): リノートの判定が甘いのを修正 (#14396)
* fix(frontend): リノートの判定が甘いのを修正 * fix * Update Changelog * fix * use type assertion * fix + add comments * lint * misskey-jsに移動 * PureRenote -> Renote * isRenote -> isPureRenote
Diffstat (limited to 'packages/misskey-js/src/note.ts')
-rw-r--r--packages/misskey-js/src/note.ts12
1 files changed, 12 insertions, 0 deletions
diff --git a/packages/misskey-js/src/note.ts b/packages/misskey-js/src/note.ts
new file mode 100644
index 0000000000..5c8298c7e4
--- /dev/null
+++ b/packages/misskey-js/src/note.ts
@@ -0,0 +1,12 @@
+import type { Note, PureRenote } from './entities.js';
+
+export function isPureRenote(note: Note): note is PureRenote {
+ return (
+ note.renote != null &&
+ note.reply == null &&
+ note.text == null &&
+ note.cw == null &&
+ (note.fileIds == null || note.fileIds.length === 0) &&
+ note.poll == null
+ );
+}