Fix image import from cryptpad

This commit is contained in:
Wolfgang Ginolas 2023-10-17 10:19:26 +02:00
parent b1e8122ee4
commit 2d63fec040
3 changed files with 5 additions and 3 deletions

View File

@ -36,7 +36,8 @@ define([
return {
openImageDialog: function(common, integrationChannel, data, cb) {
if (integrationChannel) {
integrationChannel.query('Q_INTEGRATION_ON_INSERT_IMAGE', data, cb, {raw: true});
const ignoreFirstParam = (_, image) => cb(image);
integrationChannel.query('Q_INTEGRATION_ON_INSERT_IMAGE', data, ignoreFirstParam, {raw: true});
return;
}
common.openFilePicker({
@ -46,7 +47,7 @@ define([
fileType: ['image/', 'application/x-drawio']
}
}, (data) => {
getImage(data, function(blob) {
getImage(common, data, function(blob) {
common.setPadAttribute('atime', +new Date(), null, data.href);
cb({
name: data.name,

View File

@ -125,7 +125,7 @@ define([
APP.addImage = function() {
return new Promise((resolve) => {
framework.insertImage({}, (_, image) => {
framework.insertImage({}, (image) => {
resolve(image);
});
});

View File

@ -34,6 +34,7 @@ define([
// On new command
var msg = data.msg;
if (!msg) { return; }
var txid = data.txid;
if (commands[msg.q]) {
commands[msg.q](msg.data, function (args) {