const { ipcEmit } = require("./utils/emitter");
const { launchSession, endSession } = require("./session");
-// store.set("account", "smith12@gmail.com");
+store.set("account", "smith12@gmail.com");
store.set("account", "adgundersen@gmail.com");
async function login(_e, email, password)
backgroundMitt.on("write", (int16Arr) => {
clearTimeout(setWriteId);
- setWriteId = setTimeout(setPlaybackStatus.prototype.bind(null, false), 500);
+ setWriteId = setTimeout(() => {
+ setPlaybackStatus(false);
+ }, 500);
});
function setStreams()
exports.terminateAudio = terminateAudio;
exports.playback = playback;
exports.streamState = streamState;
-
-
-// setWriteId = setTimeout(() => {
-// setPlaybackStatus(false);
-// }, 500);
}
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 };
<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>`
};
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);
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;
}
});
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"
{
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);
html, body {
margin: 0;
padding: 0;
- background-color: rgba(235, 235, 235, 0.75);
+ /*background-color: rgba(235, 235, 235, 0.75);*/
}
/* The first word of the class is the component that it modifys. */
font-family: SF Compact Display;
font-size: 12px;
color: #898989;
+ overflow: w;
+ word-wrap: break-word;
}
#header-menu {
align-items: flex-start;
}
+.admin-message {
+ align-items: center;
+}
+
.bubble {
position: relative;
max-width: 66vw;
font-size: 14px;
border-radius: 18px;
margin-bottom: 4px;
+ overflow-wrap: break-word;
}
.bubble-notify {
{
const update = messageQueue.shift();
- console.log(update);
-
if (update)
{
if (update.person)
{
ui.person = update;
}
- else if (update.content)
+ else if (update.modifier)
{
ui.messages.push(update);
}
- else if (typeof update == Array)
- {
- ui.messages.push(...update);
- }
else if (update.category)
{
search(update.message).content.push(update);
frame: false,
minWidth: 350,
minHeight: 500,
+ backgroundColor: "#EBEBEB",
webPreferences: { preload: path.join(__dirname, "/render/preload.js") }
})