Fixed trash in Google Drive workspace

This commit is contained in:
Benoit Schweblin 2018-04-11 16:19:20 +01:00
parent 80d9f8b020
commit 4efedee172

View File

@ -368,12 +368,22 @@ export default providerRegistry.register({
ifNotTooLate, ifNotTooLate,
); );
} }
// Type `file` or `folder`
// For type `file` or `folder`
const parentSyncData = store.getters['data/syncDataByItemId'][item.parentId]; const parentSyncData = store.getters['data/syncDataByItemId'][item.parentId];
let parentId;
if (item.parentId === 'trash') {
parentId = workspace.trashFolderId;
} else if (parentSyncData) {
parentId = parentSyncData.id;
} else {
parentId = workspace.folderId;
}
return googleHelper.uploadFile( return googleHelper.uploadFile(
syncToken, syncToken,
item.name, item.name,
[parentSyncData ? parentSyncData.id : workspace.folderId], [parentId],
{ {
id: item.id, id: item.id,
folderId: workspace.folderId, folderId: workspace.folderId,