minor clean up

pull/1/head
ansuz 8 years ago
parent 525d35c9ec
commit fbebbf0dca

@ -119,18 +119,14 @@ define([
}; };
var getUid = common.getUid = function () { var getUid = common.getUid = function () {
if (store) { if (store && store.getProxy() && store.getProxy().proxy) {
if (store.getProxy() && store.getProxy().proxy) { return store.getProxy().proxy.uid;
return store.getProxy().proxy.uid;
}
} }
}; };
var getRealtime = common.getRealtime = function () { var getRealtime = common.getRealtime = function () {
if (store) { if (store && store.getProxy() && store.getProxy().info) {
if (store.getProxy() && store.getProxy().info) {
return store.getProxy().info.realtime; return store.getProxy().info.realtime;
}
} }
return; return;
}; };
@ -255,7 +251,7 @@ define([
var migrateRecentPads = common.migrateRecentPads = function (pads) { var migrateRecentPads = common.migrateRecentPads = function (pads) {
return pads.map(function (pad) { return pads.map(function (pad) {
var hash; var hash;
if (isArray(pad)) { if (Array.isArray(pad)) {
var href = pad[0]; var href = pad[0];
href.replace(/\#(.*)$/, function (a, h) { href.replace(/\#(.*)$/, function (a, h) {
hash = h; hash = h;
@ -298,7 +294,7 @@ define([
if (err) { cb(err, null); return; } if (err) { cb(err, null); return; }
legacy.get(storageKey, function (err2, recentPads) { legacy.get(storageKey, function (err2, recentPads) {
if (err2) { cb(err2, null); return; } if (err2) { cb(err2, null); return; }
if (isArray(recentPads)) { if (Array.isArray(recentPads)) {
cb(void 0, migrateRecentPads(recentPads)); cb(void 0, migrateRecentPads(recentPads));
return; return;
} }
@ -421,7 +417,7 @@ define([
/* fetch and migrate your pad history from the store */ /* fetch and migrate your pad history from the store */
var getRecentPads = common.getRecentPads = function (cb) { var getRecentPads = common.getRecentPads = function (cb) {
getStore().getDrive(storageKey, function (err, recentPads) { getStore().getDrive(storageKey, function (err, recentPads) {
if (isArray(recentPads)) { if (Array.isArray(recentPads)) {
checkRecentPads(recentPads); checkRecentPads(recentPads);
cb(void 0, recentPads); cb(void 0, recentPads);
return; return;
@ -822,7 +818,7 @@ define([
// //
// allowed options tags: ['a', 'hr', 'p'] // allowed options tags: ['a', 'hr', 'p']
var createDropdown = common.createDropdown = function (config) { var createDropdown = common.createDropdown = function (config) {
if (typeof config !== "object" || !isArray(config.options)) { return; } if (typeof config !== "object" || !Array.isArray(config.options)) { return; }
var allowedTags = ['a', 'p', 'hr']; var allowedTags = ['a', 'p', 'hr'];
var isValidOption = function (o) { var isValidOption = function (o) {

Loading…
Cancel
Save