Skip to content

Commit

Permalink
Merge pull request #251 from raisingthefloor/master
Browse files Browse the repository at this point in the history
Morphic for Windows v1.2 (w/ bugfix)
  • Loading branch information
christopher-rtf authored May 12, 2021
2 parents 2b070be + 0c3de97 commit c853d1b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Morphic.Client/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -946,7 +946,7 @@ private void RegisterGlobalHotKeys()
EventHandler<NHotkey.HotkeyEventArgs> loginHotKeyPressed = async (sender, e) =>
{
// NOTE: if we want the login menu item to apply cloud-saved preferences after login, we should set this flag to true
var applyPreferencesAfterLogin = true;
var applyPreferencesAfterLogin = ConfigurableFeatures.CloudSettingsTransferIsEnabled;
var args = new Dictionary<string, object?>() { { "applyPreferencesAfterLogin", applyPreferencesAfterLogin } };
await this.Dialogs.OpenDialogAsync<LoginWindow>(args);
};
Expand Down
6 changes: 6 additions & 0 deletions Morphic.Client/Dialogs/LoginWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public LoginWindow(ILogger<TravelWindow> logger, IServiceProvider serviceProvide

private readonly IServiceProvider serviceProvider;

private LoginPanel? LoginPanel = null;
private bool ApplyPreferencesAfterLogin = false;

void MorphicWindowWithArgs.SetArguments(Dictionary<String, object?> args)
Expand All @@ -55,6 +56,10 @@ void MorphicWindowWithArgs.SetArguments(Dictionary<String, object?> args)
switch (key.ToLower()) {
case "applypreferencesafterlogin":
this.ApplyPreferencesAfterLogin = (value as bool?) ?? false;
if (this.LoginPanel != null)
{
this.LoginPanel.ApplyPreferencesAfterLogin = this.ApplyPreferencesAfterLogin;
}
break;
default:
Debug.Assert(false, "Unknown argument");
Expand All @@ -74,6 +79,7 @@ private void ShowLoginPanel(bool applyPreferencesAfterLogin)
LoginPanel loginPanel = this.StepFrame.PushPanel<LoginPanel>();
loginPanel.ApplyPreferencesAfterLogin = applyPreferencesAfterLogin;
loginPanel.Completed += (sender, args) => this.Close();
this.LoginPanel = loginPanel;
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions Morphic.Client/Menu/MorphicMenu.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -270,12 +270,12 @@ private async void Logout(object sender, RoutedEventArgs e)
await App.Current.MorphicSession.SignOut();
}

private void Login(object sender, RoutedEventArgs e)
private async void Login(object sender, RoutedEventArgs e)
{
// NOTE: if we want the login menu item to apply cloud-saved preferences after login, we should set this flag to true
var applyPreferencesAfterLogin = false;
var applyPreferencesAfterLogin = ConfigurableFeatures.CloudSettingsTransferIsEnabled;
var args = new Dictionary<string, object?>() { { "applyPreferencesAfterLogin", applyPreferencesAfterLogin } };
App.Current.Dialogs.OpenDialogAsync<LoginWindow>(args);
await App.Current.Dialogs.OpenDialogAsync<LoginWindow>(args);
}

private async void ExploreMorphicClicked(object sender, RoutedEventArgs e)
Expand Down
2 changes: 1 addition & 1 deletion Morphic.Client/appsettings.Debug.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"FrontEndUrlAsString": "http://localhost:8080/"
},
"Update": {
"AppCastUrl": ""
"AppCastUrl": ""
},
"Countly": {
"ServerUrl": "https://countly.morphic.dev",
Expand Down

0 comments on commit c853d1b

Please sign in to comment.