Disable crowdfunding message for premium users

This commit is contained in:
yflory 2018-09-14 11:21:52 +02:00
parent 6257b23f16
commit 1895d6cbd8
4 changed files with 8 additions and 2 deletions

View File

@ -13,6 +13,8 @@ define(function () {
storageKey: 'filesData', storageKey: 'filesData',
tokenKey: 'loginToken', tokenKey: 'loginToken',
displayPadCreationScreen: 'displayPadCreationScreen', displayPadCreationScreen: 'displayPadCreationScreen',
deprecatedKey: 'deprecated' deprecatedKey: 'deprecated',
// Sub
plan: 'CryptPad_plan'
}; };
}); });

View File

@ -2330,6 +2330,9 @@ define([
UIElements.displayCrowdfunding = function (common) { UIElements.displayCrowdfunding = function (common) {
if (crowdfundingState) { return; } if (crowdfundingState) { return; }
if (AppConfig.disableCrowdfundingMessages) { return; } if (AppConfig.disableCrowdfundingMessages) { return; }
var priv = common.getMetadataMgr().getPrivateData();
if (priv.plan) { return; }
crowdfundingState = true; crowdfundingState = true;
setTimeout(function () { setTimeout(function () {
common.getAttribute(['general', 'crowdfunding'], function (err, val) { common.getAttribute(['general', 'crowdfunding'], function (err, val) {

View File

@ -1433,7 +1433,7 @@ define([
postMessage("INIT_RPC", null, waitFor(function (obj) { postMessage("INIT_RPC", null, waitFor(function (obj) {
console.log('RPC handshake complete'); console.log('RPC handshake complete');
if (obj.error) { return; } if (obj.error) { return; }
localStorage.plan = obj.plan; localStorage[Constants.plan] = obj.plan;
})); }));
} else if (PINNING_ENABLED) { } else if (PINNING_ENABLED) {
console.log('not logged in. pads will not be pinned'); console.log('not logged in. pads will not be pinned');

View File

@ -262,6 +262,7 @@ define([
donateURL: Cryptpad.donateURL, donateURL: Cryptpad.donateURL,
upgradeURL: Cryptpad.upgradeURL upgradeURL: Cryptpad.upgradeURL
}, },
plan: localStorage[Utils.Constants.plan],
isNewFile: isNewFile, isNewFile: isNewFile,
isDeleted: isNewFile && window.location.hash.length > 0, isDeleted: isNewFile && window.location.hash.length > 0,
forceCreationScreen: forceCreationScreen, forceCreationScreen: forceCreationScreen,