Remove/fix XXX

pull/1/head
yflory 5 years ago
parent 72ccd55e83
commit 7b82d9dba4

@ -1601,14 +1601,9 @@ define([
.text(Messages.accessButton))
.click(common.prepareFeedback(type))
.click(function () {
common.isPadStored(function (err, data) { // XXX not necessary for access modal?
if (!data) {
return void UI.alert(Messages.autostore_notAvailable);
}
require(['/common/inner/access.js'], function (Access) {
Access.getAccessModal(common, {}, function (e) {
if (e) { console.error(e); }
});
require(['/common/inner/access.js'], function (Access) {
Access.getAccessModal(common, {}, function (e) {
if (e) { console.error(e); }
});
});
});

@ -1000,6 +1000,7 @@ define([
cb = cb || function () {};
opts = opts || {};
opts.wide = true;
opts.access = true;
var tabs = [{
getTab: getAccessTab,
title: Messages.access_main,

@ -1,11 +1,12 @@
define([
'jquery',
'/common/common-util.js',
'/common/common-hash.js',
'/common/common-interface.js',
'/common/common-ui-elements.js',
'/customize/messages.js',
'/bower_components/nthen/index.js',
], function ($, Util, UI, UIElements, Messages, nThen) {
], function ($, Util, Hash, UI, UIElements, Messages, nThen) {
var Modal = {};
Modal.override = function (data, obj) {
@ -23,7 +24,7 @@ define([
}, waitFor(function (md) {
if (md && md.error) { return void console.error(md.error); }
Modal.override(data, md);
if (redraw) { Env.evRedrawAll.fire(redraw); } // XXX
if (redraw) { Env.evRedrawAll.fire(redraw); }
}));
};
Modal.getPadData = function (Env, opts, _cb) {
@ -32,11 +33,21 @@ define([
opts = opts || {};
var data = {};
nThen(function (waitFor) {
var base = common.getMetadataMgr().getPrivateData().origin;
var priv = common.getMetadataMgr().getPrivateData();
var base = priv.origin;
common.getPadAttribute('', waitFor(function (err, val) {
if (err || !val) {
waitFor.abort();
return void cb(err || 'EEMPTY');
if (opts.access) {
data.password = priv.password;
// Access modal and the pad is not stored: we're not an owner
// so we don't need the correct href, just the type
var h = Hash.createRandomHash(priv.app, priv.password);
data.href = base + priv.pathname + '#' + h;
} else {
waitFor.abort();
return void cb(err || 'EEMPTY');
}
return;
}
if (!val.fileType) {
delete val.owners;

@ -103,7 +103,7 @@ define([
sframeChan.on('EV_RT_ERROR', function (err) {
isReady = false;
chainpad.abort();
if (err.type === 'EUNKNOWN') { // XXX
if (err.type === 'EUNKNOWN') {
// Recoverable error: make a new chainpad
chainpad = makeChainPad();
return;

Loading…
Cancel
Save