From b45a84af3d254dc24b38c6c3c48a625ceab87b23 Mon Sep 17 00:00:00 2001 From: Daniel Bernal Date: Tue, 15 Oct 2024 17:29:32 +0200 Subject: [PATCH] DuckPlayer: Temporary Fix for Watch In Youtube (#3437) Task/Issue URL:https://app.asana.com/0/1204099484721401/1208531438887018/f Tech Design URL: CC: **Description**: There is an issue in the Frontend that causes `allowFirstVideo` to remain 'true' even if it shouldn't. This issue is triggered by sending more than one User-Settings Message per webpage view. Moving this into the enrollment conditional, will buy us time to fix the issue in the FE and C.S.S and release as part of the regular release train. --- .../DuckPlayerNavigationHandler.swift | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/DuckDuckGo/DuckPlayer/DuckPlayerNavigationHandler.swift b/DuckDuckGo/DuckPlayer/DuckPlayerNavigationHandler.swift index 4c9e4f2c71..16acb20fd1 100644 --- a/DuckDuckGo/DuckPlayer/DuckPlayerNavigationHandler.swift +++ b/DuckDuckGo/DuckPlayer/DuckPlayerNavigationHandler.swift @@ -229,15 +229,15 @@ final class DuckPlayerNavigationHandler { // Enroll user if not enrolled if !experiment.isEnrolled { experiment.assignUserToCohort() - } - - // DuckPlayer is disabled before user enrolls, - // So trigger a settings change notification - // to let the FE know about the 'actual' setting - // and update Experiment value - if experiment.isExperimentCohort { - duckPlayer.settings.triggerNotification() - experiment.duckPlayerMode = duckPlayer.settings.mode + + // DuckPlayer is disabled before user enrolls, + // So trigger a settings change notification + // to let the FE know about the 'actual' setting + // and update Experiment value + if experiment.isExperimentCohort { + duckPlayer.settings.triggerNotification() + experiment.duckPlayerMode = duckPlayer.settings.mode + } } experiment.fireYoutubePixel(videoID: videoID)