remove user-message & agen-message event listeners
This commit is contained in:
parent
08896ed1d9
commit
3bf9f54df2
11 changed files with 51 additions and 98 deletions
|
|
@ -20,7 +20,7 @@ export default function useInputController() {
|
|||
const paths = ref([]);
|
||||
const audioBubbleWidth = ref(10);
|
||||
const { emitter } = useMitt();
|
||||
const { post } = useIpc('update-recorder');
|
||||
const { post } = useIpc();
|
||||
|
||||
// send message on ENTER
|
||||
const enterCallback = (input: string) => {
|
||||
|
|
@ -29,27 +29,32 @@ export default function useInputController() {
|
|||
audio: 0,
|
||||
text: input
|
||||
};
|
||||
emitter.emit("user-message", message);
|
||||
|
||||
// trigger send animation
|
||||
emitter.emit("animate-send");
|
||||
|
||||
// send message to backend
|
||||
post('message', message);
|
||||
}
|
||||
|
||||
const {
|
||||
visualizeStreamAsPaths,
|
||||
expandBubble
|
||||
const {
|
||||
visualizeStreamAsPaths,
|
||||
expandBubble
|
||||
} = useAudioVisualizer(visualizeStream);
|
||||
|
||||
const { keyDownHandler, input } = useKeyDownHandler(enterCallback);
|
||||
|
||||
const {
|
||||
textInputXoffset,
|
||||
const {
|
||||
textInputXoffset,
|
||||
textInputYoffset,
|
||||
renderTextInput
|
||||
renderTextInput
|
||||
} = useTextVisualizer(input);
|
||||
|
||||
// stops stream recording on space key up
|
||||
function keyupHandler(e: any) {
|
||||
if (e.key === " " && visualizeStream.value) {
|
||||
|
||||
post(false);
|
||||
post('update-recorder', false);
|
||||
visualizeStream.value = false;
|
||||
paths.value = []
|
||||
audioBubbleWidth.value = 10;
|
||||
|
|
@ -79,7 +84,7 @@ export default function useInputController() {
|
|||
}
|
||||
if (input === " " && visualizeStream.value === false) {
|
||||
visualizeStream.value = true;
|
||||
post(true);
|
||||
post('update-recorder', true);
|
||||
expandBubble(audioBubbleWidth);
|
||||
visualizeStreamAsPaths(stream, paths, audioBubbleWidth);
|
||||
return;
|
||||
|
|
|
|||
Loading…
Reference in a new issue