Fix subscription button in settings

pull/1/head
yflory 7 years ago
parent 548a32090e
commit fd4ed3ce3b

@ -10,6 +10,7 @@ define([
'/customize/messages.js', '/customize/messages.js',
'/common/hyperscript.js', '/common/hyperscript.js',
'/customize/application_config.js', '/customize/application_config.js',
'/api/config',
'/bower_components/file-saver/FileSaver.min.js', '/bower_components/file-saver/FileSaver.min.js',
'css!/bower_components/bootstrap/dist/css/bootstrap.min.css', 'css!/bower_components/bootstrap/dist/css/bootstrap.min.css',
@ -26,7 +27,8 @@ define([
Hash, Hash,
Messages, Messages,
h, h,
AppConfig AppConfig,
ApiConfig
) )
{ {
var saveAs = window.saveAs; var saveAs = window.saveAs;
@ -84,6 +86,9 @@ define([
var displaynameIdx = categories.account.indexOf('cp-settings-displayname'); var displaynameIdx = categories.account.indexOf('cp-settings-displayname');
categories.account.splice(displaynameIdx, 1); categories.account.splice(displaynameIdx, 1);
} }
if (!ApiConfig.allowSubscriptions) {
delete categories.subscription;
}
var create = {}; var create = {};
@ -801,6 +806,7 @@ define([
$category.click(function () { $category.click(function () {
if (!Array.isArray(categories[key]) && categories[key].onClick) { if (!Array.isArray(categories[key]) && categories[key].onClick) {
categories[key].onClick(); categories[key].onClick();
return;
} }
active = key; active = key;
$categories.find('.cp-leftside-active').removeClass('cp-leftside-active'); $categories.find('.cp-leftside-active').removeClass('cp-leftside-active');

Loading…
Cancel
Save