public override void ViewDidLayoutSubviews() { base.ViewDidLayoutSubviews(); // this is the earliest we can show the modal login // show unconditionally on launch if (_hasShownCredentials) { if (View.Bounds != _prevBounds) { SetupDrawer(); var user = DrawXSettingsManager.LoggedInUser; if (user != null) { _drawer.LoginToServerAsync(user); _hasShownCredentials = true; // skip credentials if saved user in store } View?.SetNeedsDisplay(); } } else { EditCredentials(); _hasShownCredentials = true; } }
protected override void OnStart() { base.OnStart(); if (_drawer == null) { if (DrawXSettingsManager.HasCredentials()) { // assume we can login and be able to draw // TODO handle initial failure to login despite saved credentials SetupDrawer(); } } if (DrawXSettingsManager.LoggedInUser != null) { _drawer.LoginToServerAsync(DrawXSettingsManager.LoggedInUser); _hasShownCredentials = true; // skip credentials if saved user in store } if (!_hasShownCredentials) { EditCredentials(); _hasShownCredentials = true; } }