미디어 슬래시 명령 종류 계산 분리

This commit is contained in:
2026-07-27 11:31:06 +09:00
parent 675c45092b
commit 3515cf0ccf
7 changed files with 37 additions and 6 deletions

View File

@@ -227,6 +227,21 @@ export const resolveSlashCommand = (query) => {
export const isMediaSlashAction = (action) => ['media-image', 'media-gallery', 'media-video', 'media-audio', 'media-file']
.includes(String(action || ''))
/**
* 미디어 슬래시 action에서 미디어 선택 모달 종류를 계산한다.
* @param {string} action - 명령 action
* @returns {'image'|'gallery'|'video'|'audio'|'file'|''} 모달 종류
*/
export const getMediaPickerKindFromSlashAction = (action) => {
const normalized = String(action || '')
if (!isMediaSlashAction(normalized)) {
return ''
}
return normalized.slice('media-'.length)
}
/**
* 라이브 모드 미디어 슬래시 명령 처리 중 지연 commit을 무시할지 확인한다.
* @param {Object} options - 판별 옵션