diff --git a/ReactNativeClient/src/file-api-driver-memory.js b/ReactNativeClient/src/file-api-driver-memory.js index c267c70e7..62230390f 100644 --- a/ReactNativeClient/src/file-api-driver-memory.js +++ b/ReactNativeClient/src/file-api-driver-memory.js @@ -6,10 +6,6 @@ class FileApiDriverMemory { this.items_ = []; } - listReturnsFullPath() { - return true; - } - itemIndexByPath(path) { for (let i = 0; i < this.items_.length; i++) { if (this.items_[i].path == path) return i; @@ -55,6 +51,7 @@ class FileApiDriverMemory { let s = item.path.substr(path.length + 1); if (s.split('/').length === 1) { let it = Object.assign({}, item); + it.path = it.path.substr(path.length + 1); output.push(it); } } diff --git a/ReactNativeClient/src/file-api-driver-onedrive.js b/ReactNativeClient/src/file-api-driver-onedrive.js index b5faad68e..cae77ee7e 100644 --- a/ReactNativeClient/src/file-api-driver-onedrive.js +++ b/ReactNativeClient/src/file-api-driver-onedrive.js @@ -12,10 +12,6 @@ class FileApiDriverOneDrive { return this.api_; } - listReturnsFullPath() { - return false; - } - itemFilter_() { return { select: 'name,file,folder,fileSystemInfo', diff --git a/ReactNativeClient/src/file-api.js b/ReactNativeClient/src/file-api.js index d00fb6905..2bf852966 100644 --- a/ReactNativeClient/src/file-api.js +++ b/ReactNativeClient/src/file-api.js @@ -17,31 +17,12 @@ class FileApi { return output; } - scopeItemToBaseDir_(item) { - if (!this.driver_.listReturnsFullPath()) return item; - - let output = Object.assign({}, item); - output.path = item.path.substr(this.baseDir_.length + 1); - return output; - } - - scopeItemsToBaseDir_(items) { - if (!this.driver_.listReturnsFullPath()) return items; - - let output = []; - for (let i = 0; i < items.length; i++) { - output.push(this.scopeItemToBaseDir_(items[i])); - } - return output; - } - list(path = '', options = null) { if (!options) options = {}; if (!('includeHidden' in options)) options.includeHidden = false; this.dlog('list'); return this.driver_.list(this.baseDir_).then((items) => { - items = this.scopeItemsToBaseDir_(items); if (!options.includeHidden) { let temp = []; for (let i = 0; i < items.length; i++) {