Skip to content

TagSpaces is an offline, open source, document manager with tagging support

TSN596 - Upload Issues AWS (#1350)

Stanimird46127de8843
diff --git a/app/reducers/app.ts b/app/reducers/app.ts
index 1e72b83f5..04220d8e2 100644
--- a/app/reducers/app.ts
+++ b/app/reducers/app.ts
@@ -868,7 +868,9 @@ export const actions = {
dispatch: (actions: Object) => void,
getState: () => any
) => {
+ // const currentLocation: Location = getState().locations.find(location => location.uuid === getCurrentLocationId(getState()))
if (PlatformIO.haveObjectStoreSupport()) {
+ // && currentLocation.type === locationType.TYPE_AMPLIFY) {
const { currentDirectoryPath } = getState().app;
dispatch(actions.clearUploadDialogInt());
dispatch(actions.loadDirectoryContent(currentDirectoryPath));
@@ -1632,6 +1634,7 @@ export const actions = {
dispatch: (actions: Object) => void
) => {
fsEntries.map(entry => dispatch(actions.reflectCreateEntryInt(entry))); // TODO remove map and set state once
+ dispatch(actions.setSelectedEntries(fsEntries));
},
reflectCreateEntry: (path: string, isFile: boolean) => (
dispatch: (actions: Object) => void
diff --git a/app/reducers/locations.ts b/app/reducers/locations.ts
index 6866d0ac3..cb803be78 100644
--- a/app/reducers/locations.ts
+++ b/app/reducers/locations.ts
@@ -33,7 +33,8 @@ export const types = {
export const locationType = {
TYPE_LOCAL: '0',
- TYPE_CLOUD: '1'
+ TYPE_CLOUD: '1',
+ TYPE_AMPLIFY: '2'
};
export type Location = {
@@ -256,19 +257,8 @@ export const actions = {
// Selectors
export const getLocations = (state: any): Array<Location> => state.locations;
-export const getLocation = (
- state: any,
- locationId: string
-): Location | null => {
- let foundLocation = null;
- state.locations.map(location => {
- if (location.uuid === locationId) {
- foundLocation = location;
- }
- return true;
- });
- return foundLocation;
-};
+export const getLocation = (state: any, locationId: string): Location | null =>
+ state.locations.find(location => location.uuid === locationId);
export const getDefaultLocationId = (state: any): string | undefined => {
let defaultLocationID;
state.locations.map(location => {
diff --git a/app/services/cordova-io.ts b/app/services/cordova-io.ts
index 521672a2e..85f57cfb9 100644
--- a/app/services/cordova-io.ts
+++ b/app/services/cordova-io.ts
@@ -848,7 +848,8 @@ export default class CordovaIO {
),
size: 0, // TODO debug evt and set size
lmdt: new Date().getTime(),
- isNewFile
+ isNewFile,
+ tags: []
});
};
if (isRaw) {
diff --git a/app/services/electron-io.ts b/app/services/electron-io.ts
index 33cd11827..c5196d669 100644
--- a/app/services/electron-io.ts
+++ b/app/services/electron-io.ts
@@ -707,9 +707,9 @@ export default class ElectronIO {
this.getPropertiesPromise(filePath)
.then((entry: FileSystemEntry) => {
if (entry && entry.isFile && overwrite) {
- saveFile({ ...entry, isNewFile: false }, content);
+ saveFile({ ...entry, isNewFile: false, tags: [] }, content);
} else {
- saveFile({ ...entry, isNewFile: true }, content);
+ saveFile({ ...entry, isNewFile: true, tags: [] }, content);
}
return true;
})
@@ -725,7 +725,8 @@ export default class ElectronIO {
extension: extractFileExtension(filePath, AppConfig.dirSeparator),
size: 0,
lmdt: new Date().getTime(),
- isNewFile: true
+ isNewFile: true,
+ tags: []
};
saveFile(fsEntry, content);
});
diff --git a/app/services/objectstore-io.ts b/app/services/objectstore-io.ts
index 2c0cffff7..a6187c18a 100644
--- a/app/services/objectstore-io.ts
+++ b/app/services/objectstore-io.ts
@@ -626,6 +626,7 @@ export default class ObjectStoreIO {
extension: extractFileExtension(filePath, '/'),
size: content.length,
lmdt: new Date().getTime(),
+ tags: [],
isNewFile
});
})
@@ -707,7 +708,7 @@ export default class ObjectStoreIO {
return this.objectStore
.copyObject({
Bucket: this.config.bucketName,
- CopySource: this.config.bucketName + '/' + nFilePath,
+ CopySource: this.config.bucketName + '/' + nFilePath, // this.encodeS3URI(nFilePath),
Key: nNewFilePath
})
.promise()
diff --git a/app/services/utils-io.ts b/app/services/utils-io.ts
index 56c29f608..01bbc3838 100644
--- a/app/services/utils-io.ts
+++ b/app/services/utils-io.ts
@@ -50,7 +50,7 @@ export interface FileSystemEntry {
perspective?: string;
textContent?: string;
description?: string;
- tags?: Array<Tag>;
+ tags: Array<Tag>;
size: number;
lmdt: number;
path: string;
diff --git a/app/services/webdav-io.ts b/app/services/webdav-io.ts
index e0c3b671a..72b037d5f 100644
--- a/app/services/webdav-io.ts
+++ b/app/services/webdav-io.ts
@@ -479,7 +479,8 @@ export default class WebDAVIO {
),
size: 0,
lmdt: new Date().getTime(),
- isNewFile
+ isNewFile,
+ tags: []
});
} else {
reject('saveFilePromise: ' + filePath + ' failed ' + status1);