Skip to content

Commit 5611138

Browse files
committed
updates
1 parent 962ab66 commit 5611138

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

components/google_drive/sources/changes-to-files-in-drive/changes-to-files-in-drive.mjs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,15 +87,14 @@ export default {
8787
modifiedTime: tsString,
8888
} = data;
8989
const ts = Date.parse(tsString);
90-
const eventId = headers && headers["x-goog-message-number"];
9190
const resourceState = headers && headers["x-goog-resource-state"];
9291

9392
const summary = resourceState
9493
? `${resourceState.toUpperCase()} - ${fileName || "Untitled"}`
9594
: fileName || "Untitled";
9695

9796
return {
98-
id: `${fileId}-${eventId || ts}`,
97+
id: `${fileId}-${ts}`,
9998
summary,
10099
ts,
101100
};
@@ -119,15 +118,15 @@ export default {
119118
},
120119
async processChange(file, headers) {
121120
const changes = this.getChanges(headers);
121+
const fileInfo = await this.googleDrive.getFile(file.id);
122122
if (this.includeLink) {
123-
file.file = await stashFile(file, this.googleDrive, this.dir);
123+
fileInfo.file = await stashFile(file, this.googleDrive, this.dir);
124124
}
125-
const fileInfo = await this.googleDrive.getFile(file.id);
126125
const eventToEmit = {
127126
file: fileInfo,
128127
...changes,
129128
};
130-
const meta = this.generateMeta(fileInfo, headers);
129+
const meta = this.generateMeta(fileInfo, headers); console.log(meta);
131130
this.$emit(eventToEmit, meta);
132131
},
133132
async processChanges(changedFiles, headers) {

components/google_drive/sources/changes-to-specific-files-shared-drive/changes-to-specific-files-shared-drive.mjs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,15 +92,14 @@ export default {
9292
modifiedTime: tsString,
9393
} = data;
9494
const ts = Date.parse(tsString);
95-
const eventId = headers && headers["x-goog-message-number"];
9695
const resourceState = headers && headers["x-goog-resource-state"];
9796

9897
const summary = resourceState
9998
? `${resourceState.toUpperCase()} - ${fileName || "Untitled"}`
10099
: fileName || "Untitled";
101100

102101
return {
103-
id: `${fileId}-${eventId || ts}`,
102+
id: `${fileId}-${ts}`,
104103
summary,
105104
ts,
106105
};
@@ -124,10 +123,10 @@ export default {
124123
},
125124
async processChange(file, headers) {
126125
const changes = this.getChanges(headers);
126+
const fileInfo = await this.googleDrive.getFile(file.id);
127127
if (this.includeLink) {
128-
file.file = await stashFile(file, this.googleDrive, this.dir);
128+
fileInfo.file = await stashFile(file, this.googleDrive, this.dir);
129129
}
130-
const fileInfo = await this.googleDrive.getFile(file.id);
131130
const eventToEmit = {
132131
file: fileInfo,
133132
...changes,

0 commit comments

Comments
 (0)