remove getPadTitle
This commit is contained in:
parent
f42da4ecd8
commit
8f4dbcf4c6
@ -562,32 +562,6 @@ load pinpad dynamically only after you know that it will be needed */
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
// STORAGE
|
|
||||||
var getPadTitle = common.getPadTitle = function (cb) {
|
|
||||||
var href = window.location.href;
|
|
||||||
var parsed = parsePadUrl(window.location.href);
|
|
||||||
var hashSlice = window.location.hash.slice(1,9); // TODO remove
|
|
||||||
var title = '';
|
|
||||||
|
|
||||||
getRecentPads(function (err, pads) {
|
|
||||||
if (err) {
|
|
||||||
cb(err);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
pads.some(function (pad) {
|
|
||||||
var p = parsePadUrl(pad.href);
|
|
||||||
if (p.hash === parsed.hash && p.type === parsed.type) {
|
|
||||||
title = pad.title || hashSlice;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
if (title === '') { title = getDefaultName(parsed, pads); }
|
|
||||||
|
|
||||||
cb(void 0, title);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
var errorHandlers = [];
|
var errorHandlers = [];
|
||||||
common.onError = function (h) {
|
common.onError = function (h) {
|
||||||
if (typeof h !== "function") { return; }
|
if (typeof h !== "function") { return; }
|
||||||
|
|||||||
@ -781,15 +781,6 @@ define([
|
|||||||
}
|
}
|
||||||
|
|
||||||
Cryptpad.onDisplayNameChanged(setName);
|
Cryptpad.onDisplayNameChanged(setName);
|
||||||
|
|
||||||
Cryptpad.getPadTitle(function (err, title) {
|
|
||||||
if (err) {
|
|
||||||
error(err);
|
|
||||||
debug("Couldn't get pad title");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
updateTitle(title || defaultName);
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// don't initialize until the store is ready.
|
// don't initialize until the store is ready.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user