mirror of
https://github.com/multipleof4/sune.git
synced 2026-08-28 01:05:47 +00:00
Fix: Order folders, md files, then chat threads
Co-authored-by: gemini-3.7-flash <noreply@google.com>
This commit is contained in:
@@ -45,9 +45,8 @@ const threadRow=t=>{const icon=t.type==='folder'?'folder':(t.type==='file'?'file
|
||||
let sortedThreads=[],isAddingThreads=false;const THREAD_PAGE_SIZE=50;
|
||||
async function renderThreads(){
|
||||
sortedThreads=[...THREAD.list].filter(t=>t.status!=='deleted').sort((a,b)=>{
|
||||
if(a.type==='file'&&b.type!=='file')return -1;
|
||||
if(a.type!=='file'&&b.type==='file')return 1;
|
||||
return (b.pinned-a.pinned)||(b.updatedAt-a.updatedAt);
|
||||
const r=t=>t.type==='folder'?0:t.type==='file'?1:2;
|
||||
return (r(a)-r(b))||(b.pinned-a.pinned)||(b.updatedAt-a.updatedAt);
|
||||
});
|
||||
el.threadList.innerHTML=sortedThreads.slice(0,THREAD_PAGE_SIZE).map(threadRow).join('');
|
||||
el.threadList.scrollTop=0;
|
||||
|
||||
Reference in New Issue
Block a user