Add lastDate property to Chat interface and update chat lastDate on preload

This commit is contained in:
Kwaroran
2025-03-10 22:25:08 +09:00
parent 40bf90a9df
commit 2738237f6b
2 changed files with 3 additions and 1 deletions

View File

@@ -164,7 +164,7 @@ export async function makeColdData(){
for(let j=0;j<DBState.db.characters[i].chats.length;j++){
const chat = DBState.db.characters[i].chats[j]
let greatestTime = 0
let greatestTime = chat.lastDate ?? 0
if(chat.message.length < 4){
//it is inefficient to store small data
@@ -215,6 +215,7 @@ export async function preLoadChat(characterIndex:number, chatIndex:number){
const coldData = await getColdStorageItem(coldDataKey)
if(coldData){
chat.message = coldData
chat.lastDate = Date.now()
}
await setColdStorageItem(coldDataKey + '_accessMeta', {
lastAccess: Date.now()

View File

@@ -1332,6 +1332,7 @@ export interface Chat{
fmIndex?:number
hypaV3Data?:SerializableHypaV3Data
folderId?:string
lastDate?:number
}
export interface ChatFolder{