use correct store api calls in frame.js

also don't log unnecessarily
pull/1/head
ansuz 8 years ago
parent dcc9810a42
commit a094e3c02e

@ -115,7 +115,6 @@ define([
Cryptpad.ready(function () { Cryptpad.ready(function () {
console.log("ready"); console.log("ready");
Cryptpad.getRecentPads(function (err, recentPads) { Cryptpad.getRecentPads(function (err, recentPads) {
console.log(recentPads);
if (err) { if (err) {
console.log("unable to get recent pads"); console.log("unable to get recent pads");
console.error(err); console.error(err);

@ -108,7 +108,7 @@
send('set', key, val, cb); send('set', key, val, cb);
}; };
var batchset = frame.batchset = function (map, cb) { var batchset = frame.setBatch = function (map, cb) {
send('batchset', void 0, map, cb); send('batchset', void 0, map, cb);
}; };
@ -116,7 +116,7 @@
send('get', key, void 0, cb); send('get', key, void 0, cb);
}; };
var batchget = frame.batchget = function (keys, cb) { var batchget = frame.getBatch = function (keys, cb) {
send('batchget', void 0, keys, cb); send('batchget', void 0, keys, cb);
}; };
@ -124,7 +124,7 @@
send('remove', key, void 0, cb); send('remove', key, void 0, cb);
}; };
var batchremove = frame.batchremove = function (keys, cb) { var batchremove = frame.removeBatch = function (keys, cb) {
send('batchremove', void 0, keys, cb); send('batchremove', void 0, keys, cb);
}; };

@ -159,7 +159,6 @@ define([
} }
getRecentPads(function (err, recentPads) { getRecentPads(function (err, recentPads) {
console.log(recentPads);
setRecentPads(recentPads.filter(function (pad) { setRecentPads(recentPads.filter(function (pad) {
if (pad.href !== href) { if (pad.href !== href) {
return true; return true;
@ -179,7 +178,10 @@ define([
return k.indexOf(hash) === 0; return k.indexOf(hash) === 0;
}); });
if (!toRemove.length) { return; } if (!toRemove.length) {
cb();
return;
}
Store.removebatch(toRemove, function (err, data) { Store.removebatch(toRemove, function (err, data) {
cb(err, data); cb(err, data);
}); });

Loading…
Cancel
Save