mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-01-26 19:09:52 +00:00
refactor: reduce global survey cooldown from 14 to 4 days
This commit is contained in:
@@ -134,12 +134,12 @@ describe('useSurveyEligibility', () => {
|
||||
|
||||
it('is not eligible during global cooldown', async () => {
|
||||
setFeatureUsage('test-feature', 5)
|
||||
const thirteenDaysAgo = Date.now() - 13 * 24 * 60 * 60 * 1000
|
||||
const threeDaysAgo = Date.now() - 3 * 24 * 60 * 60 * 1000
|
||||
localStorage.setItem(
|
||||
SURVEY_STATE_KEY,
|
||||
JSON.stringify({
|
||||
seenSurveys: { 'other-feature': thirteenDaysAgo },
|
||||
lastSurveyShown: thirteenDaysAgo,
|
||||
seenSurveys: { 'other-feature': threeDaysAgo },
|
||||
lastSurveyShown: threeDaysAgo,
|
||||
optedOut: false
|
||||
})
|
||||
)
|
||||
@@ -154,12 +154,12 @@ describe('useSurveyEligibility', () => {
|
||||
|
||||
it('is eligible after global cooldown expires', async () => {
|
||||
setFeatureUsage('test-feature', 5)
|
||||
const fifteenDaysAgo = Date.now() - 15 * 24 * 60 * 60 * 1000
|
||||
const fiveDaysAgo = Date.now() - 5 * 24 * 60 * 60 * 1000
|
||||
localStorage.setItem(
|
||||
SURVEY_STATE_KEY,
|
||||
JSON.stringify({
|
||||
seenSurveys: { 'other-feature': fifteenDaysAgo },
|
||||
lastSurveyShown: fifteenDaysAgo,
|
||||
seenSurveys: { 'other-feature': fiveDaysAgo },
|
||||
lastSurveyShown: fiveDaysAgo,
|
||||
optedOut: false
|
||||
})
|
||||
)
|
||||
|
||||
@@ -23,7 +23,7 @@ interface SurveyState {
|
||||
}
|
||||
|
||||
const STORAGE_KEY = 'Comfy.SurveyState'
|
||||
const GLOBAL_COOLDOWN_MS = 14 * 24 * 60 * 60 * 1000 // 14 days
|
||||
const GLOBAL_COOLDOWN_MS = 4 * 24 * 60 * 60 * 1000 // 4 days
|
||||
const DEFAULT_THRESHOLD = 3
|
||||
const DEFAULT_DELAY_MS = 5000
|
||||
|
||||
|
||||
Reference in New Issue
Block a user