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',
tokenKey: 'loginToken',
displayPadCreationScreen: 'displayPadCreationScreen',
deprecatedKey: 'deprecated'
deprecatedKey: 'deprecated',
// Sub
plan: 'CryptPad_plan'
};
});

View File

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

View File

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

View File

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