@@ -52,13 +52,6 @@ define(function (require, exports, module) {
5252 const STEP_START_DELAY_MS = 2500 ;
5353 const STEP1_INVITE_MS = 1800 ;
5454 const STEP1_DESIGN_MODE_HOLD_MS = 2000 ;
55- // Hard cap on how long we'll wait for the pro trial start dialog to be
56- // dismissed before starting the tour. The dialog is shown on every fresh
57- // first-run boot (where this tour also runs), so under normal conditions
58- // the wait is bounded by the user dismissing it. The cap protects edge
59- // cases where the dialog isn't shown at all (e.g. user already has a
60- // subscription / a prior expired trial).
61- const TRIAL_DIALOG_WAIT_TIMEOUT_MS = 60000 ;
6255
6356 function _loadState ( ) {
6457 const raw = PhStore . getItem ( TOUR_STORAGE_KEY ) ;
@@ -417,36 +410,19 @@ define(function (require, exports, module) {
417410 }
418411
419412 /**
420- * Resolves once the pro trial start dialog has been dismissed, or after
421- * TRIAL_DIALOG_WAIT_TIMEOUT_MS as a fallback for builds/runs where the
422- * dialog isn't shown.
413+ * Resolves once the pro trial start dialog has been dismissed. The
414+ * dialog is guaranteed to fire `proTrialStartDialogDismissed` on every
415+ * boot path (including builds where the dialog isn't shown), so we
416+ * just await it without a timeout fallback.
423417 */
424418 function _waitForTrialStartDialogDismissed ( ) {
425- return new Promise ( function ( resolve ) {
426- const dismissed = _LoginService && _LoginService . proTrialStartDialogDismissed ;
427- if ( ! dismissed ) {
428- // No pro trial flow exposed — proceed immediately.
429- resolve ( ) ;
430- return ;
431- }
432- let settled = false ;
433- const fallback = setTimeout ( function ( ) {
434- if ( settled ) {
435- return ;
436- }
437- settled = true ;
438- resolve ( ) ;
439- } , TRIAL_DIALOG_WAIT_TIMEOUT_MS ) ;
440- // jQuery deferred or native promise — both implement .then
441- Promise . resolve ( dismissed ) . then ( function ( ) {
442- if ( settled ) {
443- return ;
444- }
445- settled = true ;
446- clearTimeout ( fallback ) ;
447- resolve ( ) ;
448- } ) ;
449- } ) ;
419+ const dismissed = _LoginService && _LoginService . proTrialStartDialogDismissed ;
420+ // Community-edition builds expose no login service at all — skip
421+ // the wait so the tour still works there.
422+ if ( ! dismissed ) {
423+ return Promise . resolve ( ) ;
424+ }
425+ return Promise . resolve ( dismissed ) ;
450426 }
451427
452428 function startTour ( ) {
0 commit comments