Fix UI for mobile render

This commit is contained in:
2026-07-01 09:37:37 +02:00
parent 8cbc25a601
commit 8e551159fc
13 changed files with 229 additions and 172 deletions

View File

@@ -184,7 +184,30 @@ export class Content
if(!overview)
return;
return { ...overview, content: Content.fromString(overview, (await Content.read(id, { create: true }))!) };
let content = await Content.read(id);
if(content === undefined)
{
try
{
const apiContent = await useRequestFetch()(`/api/file/content/${id}`, { cache: 'no-cache' });
if(apiContent)
{
content = apiContent;
if(overview.type !== 'folder')
Content.queue.queue(() => Content.write(id, content!, { create: true }));
}
else
{
overview.error = true;
}
}
catch(e)
{
overview.error = true;
}
}
return { ...overview, content: Content.fromString(overview, content!) };
}
static set(id: string, overview?: Omit<LocalContent, 'content'> | Recursive<Omit<LocalContent, 'content'>>)
{
@@ -251,20 +274,6 @@ export class Content
{
Content._overview[file.id] = file;
Content._reverseMapping[file.path] = file.id;
Content.queue.queue(() => {
return useRequestFetch()(`/api/file/content/${file.id}`, { cache: 'no-cache' }).then(async (content: string | undefined | null) => {
if(content)
{
if(file.type !== 'folder')
Content.queue.queue(() => Content.write(file.id, content, { create: true }));
}
else
Content._overview[file.id]!.error = true;
}).catch(e => {
Content._overview[file.id]!.error = true;
});
});
}
deletable.splice(deletable.findIndex(e => e === file.id), 1);