From d5cafde7d1b1b5274fd6cb50963393037b98c4cc Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Thu, 23 Mar 2023 09:06:32 -0700 Subject: [PATCH] Revert "refactor: nyaize on the frontend" This reverts commit aff90b3ef225e5d4453469b36b7bf3a8565c7a68. --- packages/{client/src/scripts => backend/src/misc}/nyaize.ts | 0 packages/backend/src/models/repositories/note.ts | 5 +++-- packages/client/src/components/MkPostForm.vue | 5 ----- 3 files changed, 3 insertions(+), 7 deletions(-) rename packages/{client/src/scripts => backend/src/misc}/nyaize.ts (100%) diff --git a/packages/client/src/scripts/nyaize.ts b/packages/backend/src/misc/nyaize.ts similarity index 100% rename from packages/client/src/scripts/nyaize.ts rename to packages/backend/src/misc/nyaize.ts diff --git a/packages/backend/src/models/repositories/note.ts b/packages/backend/src/models/repositories/note.ts index ca284b9237..882cfdd318 100644 --- a/packages/backend/src/models/repositories/note.ts +++ b/packages/backend/src/models/repositories/note.ts @@ -12,6 +12,7 @@ import { Channels, } from "../index.js"; import type { Packed } from "@/misc/schema.js"; +import { nyaize } from "@/misc/nyaize.js"; import { awaitAll } from "@/prelude/await-all.js"; import { convertLegacyReaction, @@ -262,7 +263,7 @@ export const NoteRepository = db.getRepository(Note).extend({ : {}), }); - /* if (packed.user.isCat && packed.text) { + if (packed.user.isCat && packed.text) { const tokens = packed.text ? mfm.parse(packed.text) : []; mfm.inspect(tokens, (node) => { if (node.type === "text") { @@ -271,7 +272,7 @@ export const NoteRepository = db.getRepository(Note).extend({ } }); packed.text = mfm.toString(tokens); - } */ + } return packed; }, diff --git a/packages/client/src/components/MkPostForm.vue b/packages/client/src/components/MkPostForm.vue index e9d3de02f7..7ce990b214 100644 --- a/packages/client/src/components/MkPostForm.vue +++ b/packages/client/src/components/MkPostForm.vue @@ -91,7 +91,6 @@ import { instance } from '@/instance'; import { $i, getAccounts, openAccountMenu as openAccountMenu_ } from '@/account'; import { uploadFile } from '@/scripts/upload'; import { deepClone } from '@/scripts/clone'; -import { nyaize } from '@/scripts/nyaize'; import XCheatSheet from '@/components/MkCheatSheetDialog.vue'; const modal = inject('modal'); @@ -583,10 +582,6 @@ async function post() { } } - if ($i?.isCat && (postData.text != null || postData.text!.length === 0)) { - postData.text = nyaize(`${postData.text}`); - } - let token = undefined; if (postAccount) {