Skip to content

Commit

Permalink
フロントでの埋め込み置換を削除
Browse files Browse the repository at this point in the history
  • Loading branch information
TwoSquirrels committed Oct 1, 2024
1 parent d55e4bc commit 8ce06a5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 184 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type { ChannelId } from '/@/types/entity-ids'
import apis, { buildFilePathForPost, formatResizeError } from '/@/lib/apis'
import { replace as embedInternalLink } from '/@/lib/markdown/internalLinkEmbedder'
import useChannelPath from '/@/composables/useChannelPath'
import { computed, ref, unref } from 'vue'
import { nullUuid } from '/@/lib/basic/uuid'
Expand Down Expand Up @@ -93,23 +92,10 @@ const usePostMessage = (
bothChannelsMapInitialFetchPromise.value
])

const embededText = embedInternalLink(state.text, {
getUser: findUserByName,
getGroup: getUserGroupByName,
getChannel: path => {
try {
const id = channelPathToId(path.split('/'), channelTree.value)
return { id }
} catch {
return undefined
}
}
})

const dummyFileUrls = state.attachments.map(() =>
buildFilePathForPost(nullUuid)
)
const dummyText = createContent(embededText, dummyFileUrls)
const dummyText = createContent(state.text, dummyFileUrls)
if (countLength(dummyText) > MESSAGE_MAX_LENGTH) {
addErrorToast('メッセージが長すぎます')
return
Expand All @@ -124,7 +110,7 @@ const usePostMessage = (
})

await apis.postMessage(cId, {
content: createContent(embededText, fileUrls)
content: createContent(state.text, fileUrls)
})

clearState()
Expand Down
168 changes: 0 additions & 168 deletions src/lib/markdown/internalLinkEmbedder.ts

This file was deleted.

0 comments on commit 8ce06a5

Please sign in to comment.