mirror of
https://github.com/cryptpad/cryptpad.git
synced 2026-09-14 11:05:41 +05:00
Fix image import from cryptpad
This commit is contained in:
parent
b1e8122ee4
commit
2d63fec040
@ -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,
|
||||
|
||||
@ -125,7 +125,7 @@ define([
|
||||
|
||||
APP.addImage = function() {
|
||||
return new Promise((resolve) => {
|
||||
framework.insertImage({}, (_, image) => {
|
||||
framework.insertImage({}, (image) => {
|
||||
resolve(image);
|
||||
});
|
||||
});
|
||||
|
||||
@ -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) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user