bug fixes and other minor improvments
This commit is contained in:
parent
bd9d3aa612
commit
dac7edef21
10 changed files with 36 additions and 26 deletions
|
|
@ -9,7 +9,15 @@ const Bubble =
|
|||
}
|
||||
|
||||
Vue.onMounted(() => {
|
||||
document.getElementById("messenger").dispatchEvent(new CustomEvent('adjust-scroll'));
|
||||
|
||||
const el = document.getElementById("messenger");
|
||||
|
||||
setTimeout(() => {
|
||||
|
||||
el.dispatchEvent(new CustomEvent('adjust-scroll'));
|
||||
|
||||
}, 100);
|
||||
|
||||
});
|
||||
|
||||
return { getUrl };
|
||||
|
|
@ -28,7 +36,7 @@ const Bubble =
|
|||
|
||||
<img v-else-if="category == 'image'" :src="getUrl()" />
|
||||
|
||||
<a v-else :href="getUrl()">{{ text }}</a>
|
||||
<a v-else :download="text" :href="getUrl()">{{ text }}</a>
|
||||
|
||||
</div>`
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,6 +1,11 @@
|
|||
const onDrop = async (e) => {
|
||||
const file = e.dataTransfer.items[0].getAsFile();
|
||||
|
||||
if (file.size >= 1 * 1000 * 1000) {
|
||||
alert("File must be under 1MB.");
|
||||
return;
|
||||
}
|
||||
|
||||
const buffer = await file.arrayBuffer();
|
||||
const b64String = await window.mainApi.invoke("encode", buffer);
|
||||
|
||||
|
|
|
|||
|
|
@ -46,11 +46,17 @@ function useText(elementId, left, typing)
|
|||
|
||||
if (e.key === "Enter" && el.value)
|
||||
{
|
||||
if (el.value.length >= 250) {
|
||||
alert("250 character limit")
|
||||
return;
|
||||
}
|
||||
|
||||
window.mainApi.send("message", {
|
||||
category: "text",
|
||||
text: el.value,
|
||||
blob: null
|
||||
});
|
||||
|
||||
show.value = false;
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -18,10 +18,6 @@ const Message =
|
|||
template: `
|
||||
<div :id="id" :class="'message ' + modifier + '-message'">
|
||||
|
||||
<div class="message-session" v-if="context=='Crimata AI'">
|
||||
New Session
|
||||
</div>
|
||||
|
||||
<Bubble
|
||||
v-for="(c, index) in content"
|
||||
:category="c.category"
|
||||
|
|
|
|||
|
|
@ -33,14 +33,10 @@ const Messenger = {
|
|||
{
|
||||
person.value = update;
|
||||
}
|
||||
else if (update.content)
|
||||
else if (update.modifier)
|
||||
{
|
||||
messages.value.push(update);
|
||||
}
|
||||
else if (typeof update == Array)
|
||||
{
|
||||
messages.value.push(...update);
|
||||
}
|
||||
else if (update.category)
|
||||
{
|
||||
search(update.message).content.push(update);
|
||||
|
|
|
|||
Loading…
Reference in a new issue