feat: add account deletion, announcements and subscription renewal
Support personal records and persistent smoking visibility. Add upload quota preflight, file cleanup, privacy entry, image caching and revision-based page refresh across the backend, admin and mini program.
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
// Memory only: a cold start begins a new login session. Never persist this in storage.
|
||||
const seen = new Map();
|
||||
function shouldShow(notice, userId) {
|
||||
if (!notice || !notice.enabled || !String(notice.content || '').trim()) return false;
|
||||
const mode = notice.mode || 'login_once';
|
||||
if (mode === 'off') return false;
|
||||
if (mode === 'always') return true;
|
||||
return mode === 'login_once' && seen.get(String(userId || '')) !== notice.revision;
|
||||
}
|
||||
function markShown(notice, userId) {
|
||||
if (notice && (notice.mode || 'login_once') === 'login_once') seen.set(String(userId || ''), notice.revision);
|
||||
}
|
||||
function clear() { seen.clear(); }
|
||||
module.exports = { shouldShow, markShown, clear };
|
||||
Reference in New Issue
Block a user