Fix a truly silly mistake in rpc.js and make the pad-not-pinned message get removed if a registered user joins
This commit is contained in:
@@ -719,7 +719,7 @@ define([
|
||||
return $titleContainer;
|
||||
};
|
||||
|
||||
var createUnpinnedWarning = function (toolbar, config) {
|
||||
var createUnpinnedWarning0 = function (toolbar, config) {
|
||||
if (Common.isLoggedIn()) { return; }
|
||||
var pd = config.metadataMgr.getPrivateData();
|
||||
var o = pd.origin;
|
||||
@@ -728,7 +728,11 @@ define([
|
||||
var cid = Hash.hrefToHexChannelId(url);
|
||||
Common.sendAnonRpcMsg('IS_CHANNEL_PINNED', cid, function (x) {
|
||||
if (x.error || !Array.isArray(x.response)) { return void console.log(x); }
|
||||
if (x.response[0] === true) { return; }
|
||||
if (x.response[0] === true) {
|
||||
$('.cp-pad-not-pinned').remove();
|
||||
return;
|
||||
}
|
||||
if ($('.cp-pad-not-pinned').length) { return; }
|
||||
var pnpTitle = Messages._getKey('padNotPinned', ['','','','']);
|
||||
var pnpMsg = Messages._getKey('padNotPinned', [
|
||||
'<a href="' + o + '/login" class="cp-pnp-login" target="blank" title>',
|
||||
@@ -759,6 +763,13 @@ define([
|
||||
});
|
||||
};
|
||||
|
||||
var createUnpinnedWarning = function (toolbar, config) {
|
||||
config.metadataMgr.onChange(function () {
|
||||
createUnpinnedWarning0(toolbar, config);
|
||||
});
|
||||
createUnpinnedWarning0(toolbar, config);
|
||||
};
|
||||
|
||||
var createPageTitle = function (toolbar, config) {
|
||||
if (config.title || !config.pageTitle) { return; }
|
||||
var $titleContainer = $('<span>', {
|
||||
|
||||
Reference in New Issue
Block a user