| | 1 | | using UnityEngine; |
| | 2 | |
|
| | 3 | | namespace DCL.MyAccount |
| | 4 | | { |
| | 5 | | public class MyAccountSectionHUDController |
| | 6 | | { |
| | 7 | | private const string NEW_TOS_AND_EMAIL_SUBSCRIPTION_FF = "new_terms_of_service_and_email_subscription"; |
| | 8 | |
|
| | 9 | | private readonly IMyAccountSectionHUDComponentView view; |
| | 10 | | private readonly DataStore dataStore; |
| | 11 | |
|
| 41 | 12 | | public MyAccountSectionHUDController( |
| | 13 | | IMyAccountSectionHUDComponentView view, |
| | 14 | | DataStore dataStore) |
| | 15 | | { |
| 41 | 16 | | this.view = view; |
| 41 | 17 | | this.dataStore = dataStore; |
| | 18 | |
|
| 41 | 19 | | dataStore.exploreV2.configureMyAccountSectionInFullscreenMenu.OnChange += ConfigureMyAccountSectionInFullscr |
| 41 | 20 | | ConfigureMyAccountSectionInFullscreenMenuChanged(dataStore.exploreV2.configureMyAccountSectionInFullscreenMe |
| | 21 | |
|
| 41 | 22 | | dataStore.myAccount.isInitialized.Set(true); |
| 41 | 23 | | } |
| | 24 | |
|
| | 25 | | public void Dispose() |
| | 26 | | { |
| 41 | 27 | | dataStore.exploreV2.configureMyAccountSectionInFullscreenMenu.OnChange -= ConfigureMyAccountSectionInFullscr |
| 41 | 28 | | } |
| | 29 | |
|
| | 30 | | public void ShowAccountSettingsUpdatedToast() => |
| 28 | 31 | | view.ShowAccountSettingsUpdatedToast(); |
| | 32 | |
|
| | 33 | | private void ConfigureMyAccountSectionInFullscreenMenuChanged(Transform currentParentTransform, Transform _) |
| | 34 | | { |
| 41 | 35 | | view.SetAsFullScreenMenuMode(currentParentTransform); |
| 41 | 36 | | view.SetSectionsMenuActive(dataStore.featureFlags.flags.Get().IsFeatureEnabled(NEW_TOS_AND_EMAIL_SUBSCRIPTIO |
| 41 | 37 | | } |
| | 38 | | } |
| | 39 | | } |