Sort characters list in hot swaps

This commit is contained in:
SillyLossy
2023-05-06 00:42:29 +03:00
parent 6dbe728a6d
commit ef7f6ad096
3 changed files with 4 additions and 0 deletions

View File

@ -2696,6 +2696,8 @@ async function renameCharacter() {
async function saveChat(chat_name, withMetadata) { async function saveChat(chat_name, withMetadata) {
const metadata = { ...chat_metadata, ...(withMetadata || {}) }; const metadata = { ...chat_metadata, ...(withMetadata || {}) };
let file_name = chat_name ?? characters[this_chid].chat; let file_name = chat_name ?? characters[this_chid].chat;
characters[this_chid]['date_last_chat'] = Date.now();
sortCharactersList();
chat.forEach(function (item, i) { chat.forEach(function (item, i) {
if (item["is_group"]) { if (item["is_group"]) {
alert('Trying to save group chat with regular saveChat function. Aborting to prevent corruption.'); alert('Trying to save group chat with regular saveChat function. Aborting to prevent corruption.');

View File

@ -191,6 +191,7 @@ function resetSelectedGroup() {
async function saveGroupChat(groupId, shouldSaveGroup) { async function saveGroupChat(groupId, shouldSaveGroup) {
const group = groups.find(x => x.id == groupId); const group = groups.find(x => x.id == groupId);
const chat_id = group.chat_id; const chat_id = group.chat_id;
group['date_last_chat'] = Date.now();
const response = await fetch("/savegroupchat", { const response = await fetch("/savegroupchat", {
method: "POST", method: "POST",
headers: getRequestHeaders(), headers: getRequestHeaders(),

View File

@ -587,6 +587,7 @@ code {
transition: 250ms; transition: 250ms;
overflow: hidden; overflow: hidden;
padding: 0 !important; padding: 0 !important;
order: 100;
} }
.hotswapAvatar:hover { .hotswapAvatar:hover {