+
+
+
+
diff --git a/frontend-vue/src/views/Chat.vue b/frontend-vue/src/views/Chat.vue
index 594dfaf..7191d2e 100644
--- a/frontend-vue/src/views/Chat.vue
+++ b/frontend-vue/src/views/Chat.vue
@@ -66,10 +66,10 @@
}
// This won't fire when called, the mounted callback will take care
- watch(() => props.id, newChatId => {
+ watch(() => props.id, newId => {
if (_isMounted) {
unloadChatState();
- loadChatState(newChatId);
+ loadChatState(newId);
}
})
@@ -154,7 +154,7 @@
// === UI Helper Functions === //
- function requestRescroll ({forceBottom=false, bottomRelative=false}) {
+ function requestRescroll ({forceBottom=false, bottomRelative=false}={}) {
const elem = chatContainerElem.value;
const scroll = elem.scrollTop;
@@ -166,13 +166,14 @@
// Chat was fully scrolled down
if (forceBottom || scroll == max) {
elem.scrollTop = elem.scrollTopMax;
+ } else if (bottomRelative) {
+ // TODO: Keep scroll at the same distance from the bottom.
+ // This will be used when the user scrolls to the top and previous messages are loaded
} else {
// Do nothing, scroll remains in place
}
});
});
-
- // Something different has to be done when previous messages are added
}
function msgClass (msg) {
diff --git a/frontend-vue/src/views/ChatCreate.vue b/frontend-vue/src/views/ChatCreate.vue
index 1a643bb..f15f5ad 100644
--- a/frontend-vue/src/views/ChatCreate.vue
+++ b/frontend-vue/src/views/ChatCreate.vue
@@ -8,10 +8,7 @@
import * as ui from '../ui';
// List of agents, with their id, name, and whether they're currently selected
- const agents = ref([
- {id: 1, name: "John"},
- {id: 2, name: "Steve"},
- ]);
+ const agents = ref([]);
const title = ref("");
async function submitChat () {
@@ -31,15 +28,12 @@
}
}
- // === Initialize === //
-
onMounted(async () => {
agents.value = (await backend.getAgents()).map(it => ({
id: it.id,
name: it.name,
selected: false,
}));
- // TODO: Get agent list
});