From 620d57e9a79b767bc7b9338152da7a358792d28b Mon Sep 17 00:00:00 2001 From: DianaXWiki Date: Tue, 5 May 2026 15:24:35 +0200 Subject: [PATCH] Persist banner across reloads --- www/common/common-ui-elements.js | 8 +++++++- www/common/sframe-common-outer.js | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/www/common/common-ui-elements.js b/www/common/common-ui-elements.js index 183fdd549..593a8ade1 100644 --- a/www/common/common-ui-elements.js +++ b/www/common/common-ui-elements.js @@ -3394,6 +3394,9 @@ define([ var todo = function () { crowdfundingState = true; + var recordShown = function () { + common.getSframeChannel().query('Q_RECORD_CROWDFUNDING_SHOWN', {}, function () {}); + }; var dontShowAgain = function () { common.setAttribute(['general', 'crowdfunding'], false); Feedback.send('CROWDFUNDING_NEVER'); @@ -3406,6 +3409,7 @@ define([ className: 'cancel', iconClass: 'crowdfunding-snooze', onClick: function () { + recordShown(); Feedback.send('CROWDFUNDING_NO'); } } @@ -3416,6 +3420,7 @@ define([ className: 'primary', iconClass: 'crowdfunding-donate', onClick: function () { + recordShown(); common.openURL(priv.accounts.donateURL); Feedback.send('CROWDFUNDING_YES'); } @@ -3428,6 +3433,7 @@ define([ className: 'primary', iconClass: 'crowdfunding-donate2', onClick: function () { + recordShown(); common.openURL('/accounts/'); Feedback.send('CROWDFUNDING_SUBSCRIBE'); } @@ -3438,6 +3444,7 @@ define([ className: 'cancel left', iconClass: 'close', onClick: function () { + recordShown(); dontShowAgain(); } }); @@ -3467,7 +3474,6 @@ define([ return; } todo(); - common.getSframeChannel().query('Q_RECORD_CROWDFUNDING_SHOWN', {}, function () {}); }); }); }; diff --git a/www/common/sframe-common-outer.js b/www/common/sframe-common-outer.js index c4fc2e3f0..4814c024c 100644 --- a/www/common/sframe-common-outer.js +++ b/www/common/sframe-common-outer.js @@ -1020,7 +1020,7 @@ define([ var CROWDFUNDING_PREFIX = 'cp_crowdfunding_'; var CROWDFUNDING_DRIVE_KEY = ['general', 'crowdfunding_metrics']; // First action (opening or creating a document) count threshold before showing the banner - var CROWDFUNDING_MIN_ACTIONS = 10; + var CROWDFUNDING_MIN_ACTIONS = 5; // Additional actions required after each shown banner var CROWDFUNDING_ACTIONS_INTERVAL = 15; // Quota usage threshold for quota-based banner display