Add basic preview handling and lazy loading
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user