Skip to content

Commit

Permalink
- Temporary workaround: make importFileFromURL: not return directly w…
Browse files Browse the repository at this point in the history
…ith the placeholder, but only when upload has completed - and then return the final item
  • Loading branch information
felix-schwarz committed Jan 22, 2019
1 parent 208733c commit 6a5581d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions ownCloud File Provider/FileProviderExtension.m
Original file line number Diff line number Diff line change
Expand Up @@ -570,8 +570,8 @@ - (void)importDocumentAtURL:(NSURL *)fileURL toParentItemIdentifier:(NSFileProvi

// Start import
[self.core importFileNamed:importFileName at:parentItem fromURL:fileURL isSecurityScoped:YES options:@{ OCCoreOptionImportByCopying : @(importByCopying) } placeholderCompletionHandler:^(NSError *error, OCItem *item) {
FPLogCmd(@"Completed with placeholderItem=%@, error=%@", item, error);
completionHandler(item, error);
// FPLogCmd(@"Completed with placeholderItem=%@, error=%@", item, error);
// completionHandler(item, error);
} resultHandler:^(NSError *error, OCCore *core, OCItem *item, id parameter) {
if ([error.domain isEqual:OCHTTPStatusErrorDomain] && (error.code == OCHTTPStatusCodePRECONDITION_FAILED))
{
Expand All @@ -595,6 +595,12 @@ - (void)importDocumentAtURL:(NSURL *)fileURL toParentItemIdentifier:(NSFileProvi
}
}
}
else
{
// Temporary: call completion handler only after upload has finished - with the final item
FPLogCmd(@"Completed with item=%@, error=%@", item, error);
completionHandler(item, error);
}
}];
}
else
Expand Down

0 comments on commit 6a5581d

Please sign in to comment.