Skip to content

Commit 42c8218

Browse files
Merge pull request #9 from ScriptAddicts/FPR-936
FPR-936 Fix images not added to the generated file
2 parents 8ad18db + ac988cf commit 42c8218

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@scriptaddicts/docsserviceapp",
3-
"version": "1.0.10",
3+
"version": "1.0.11",
44
"description": "Fork of DocsServiceApp to continue support of the library",
55
"main": "index.js",
66
"scripts": {

src/apps/SpreadsheetApp/SpreadsheetAppp.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,11 +165,12 @@
165165
putError.call(this, e.message);
166166
}
167167
}
168+
let tempSheetInDestFile;
168169
try {
169170
const tmpSpreadsheet = SpreadsheetApp.openById(tmpId);
170171
tmpSheet = tmpSpreadsheet.getSheets()[0];
171172
tmpSheet.setName(`SpreadsheetAppp_${Utilities.getUuid()}`);
172-
tmpSheet.copyTo(dstSS);
173+
tempSheetInDestFile = tmpSheet.copyTo(dstSS);
173174

174175
Drive.Files.remove(tmpId);
175176
} catch (err) {
@@ -189,7 +190,7 @@
189190
}
190191
tmpSheetId = tmpSheet.getSheetId();
191192
requests = ar.map((e) => {
192-
e.from.sheetId = tmpSheetId;
193+
e.from.sheetId = tempSheetInDestFile.getSheetId();
193194
e.to.sheetId = dstSheetId;
194195
return {
195196
copyPaste: {
@@ -217,7 +218,7 @@
217218
putError.call(this, e.message);
218219
}
219220
}
220-
dstSS.deleteSheet(tmpSheet);
221+
dstSS.deleteSheet(tempSheetInDestFile);
221222
return null;
222223
}
223224

0 commit comments

Comments
 (0)