Skip to content

Commit

Permalink
Merge pull request #265 from tegnike/develop
Browse files Browse the repository at this point in the history
本番リリース
  • Loading branch information
tegnike authored Dec 16, 2024
2 parents 3c1cc8b + b5fec7c commit bff26db
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 2 deletions.
12 changes: 11 additions & 1 deletion src/components/messageInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ export const MessageInput = ({
} else {
if (textareaRef.current) {
textareaRef.current.value = ''
textareaRef.current.style.height = 'auto'
setRows(1)
textareaRef.current.focus()
}
}
Expand Down Expand Up @@ -80,6 +82,14 @@ export const MessageInput = ({
onClickMicButton(event)
}

const handleSendClick = (event: React.MouseEvent<HTMLButtonElement>) => {
onClickSendButton(event)
setRows(1)
if (textareaRef.current) {
textareaRef.current.style.height = 'auto'
}
}

return (
<div className="absolute bottom-0 z-20 w-screen">
{showPermissionModal && (
Expand Down Expand Up @@ -130,7 +140,7 @@ export const MessageInput = ({
className="bg-secondary hover:bg-secondary-hover active:bg-secondary-press disabled:bg-secondary-disabled"
isProcessing={chatProcessing}
disabled={chatProcessing || !userMessage || realtimeAPIMode}
onClick={onClickSendButton}
onClick={handleSendClick}
/>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/settings/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ const Main = () => {
const Footer = () => {
return (
<footer className="absolute py-4 bg-[#413D43] text-center text-white font-Montserrat bottom-0 w-full">
powered by ChatVRM from Pixiv. version 2.17.0
powered by ChatVRM from Pixiv. version 2.18.0
</footer>
)
}
25 changes: 25 additions & 0 deletions src/components/settings/voice.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ const Voice = () => {

const { t } = useTranslation()
const [nijivoiceSpeakers, setNijivoiceSpeakers] = useState<Array<any>>([])
const [prevNijivoiceActorId, setPrevNijivoiceActorId] = useState<string>('')

// にじボイスの話者一覧を取得する関数
const fetchNijivoiceSpeakers = async () => {
Expand All @@ -89,6 +90,30 @@ const Voice = () => {
}
}, [selectVoice, nijivoiceApiKey])

// nijivoiceActorIdが変更された時にrecommendedVoiceSpeedを設定する処理を追加
useEffect(() => {
if (
selectVoice === 'nijivoice' &&
nijivoiceActorId &&
nijivoiceActorId !== prevNijivoiceActorId
) {
// 現在選択されているキャラクターを探す
const selectedActor = nijivoiceSpeakers.find(
(actor) => actor.id === nijivoiceActorId
)

// キャラクターが見つかり、recommendedVoiceSpeedが設定されている場合
if (selectedActor?.recommendedVoiceSpeed) {
settingsStore.setState({
nijivoiceSpeed: selectedActor.recommendedVoiceSpeed,
})
}

// 前回の選択を更新
setPrevNijivoiceActorId(nijivoiceActorId)
}
}, [nijivoiceActorId, nijivoiceSpeakers, prevNijivoiceActorId, selectVoice])

// 追加: realtimeAPIMode または audioMode が true の場合にメッセージを表示
if (realtimeAPIMode || audioMode) {
return (
Expand Down

0 comments on commit bff26db

Please sign in to comment.