Skip to content

Commit

Permalink
[se] Fix error while downloadas; For bug 62643
Browse files Browse the repository at this point in the history
  • Loading branch information
konovalovsergey committed Aug 22, 2024
1 parent d24621e commit 4a1909b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions DocService/sources/canvasservice.js
Original file line number Diff line number Diff line change
Expand Up @@ -1805,7 +1805,7 @@ async function processWopiSaveAs(ctx, cmd) {
const { wopiSrc, access_token } = info.wopiParams.userAuth;
res = await wopiClient.putRelativeFile(ctx, wopiSrc, access_token, null, stream.readStream, stream.contentLength, suggestedExt, suggestedTarget, false);
}
return res;
return {res: res, wopiParams: info?.wopiParams};
}
exports.receiveTask = function(data, ack) {
return co(function* () {
Expand All @@ -1827,10 +1827,10 @@ exports.receiveTask = function(data, ack) {
yield getOutputData(ctx, cmd, outputData, cmd.getDocId(), null, additionalOutput);
} else if ('save' === command || 'savefromorigin' === command) {
let status = yield getOutputData(ctx, cmd, outputData, cmd.getDocId() + cmd.getSaveKey(), null, additionalOutput);
if (commonDefines.FileStatus.Ok === status && (undefined !== cmd.getSaveAsPath() || cmd.getIsSaveAs())) {
if (commonDefines.FileStatus.Ok === status && (cmd.getSaveAsPath() || cmd.getIsSaveAs())) {
//todo in case of wopi no need to send url. send it to avoid stubs in sdk
let saveAsRes = yield processWopiSaveAs(ctx, cmd);
if (!saveAsRes) {
if (!saveAsRes.res && saveAsRes.wopiParams) {
outputData.setStatus('err');
outputData.setData(constants.UNKNOWN);
}
Expand Down

0 comments on commit 4a1909b

Please sign in to comment.