Add basic preview handling and lazy loading

This commit is contained in:
Johannes Zellner
2023-03-29 20:02:26 +02:00
parent 1a2fffbf5c
commit 3cff44815a
3 changed files with 17 additions and 4 deletions
+7
View File
@@ -12,6 +12,13 @@ export function createDirectoryModel(origin, accessToken, appId) {
return [];
}
// if we have an image, attach previewUrl
result.body.entries.forEach(item => {
if (item.mimeType.indexOf('image/') === 0) {
item.previewUrl = `${origin}/api/v1/apps/${appId}/files/${encodeURIComponent(path + '/' + item.fileName)}?access_token=${accessToken}`
}
});
return result.body.entries;
},
async rename(oldPath, newPath) {