removed ability to send empty messages

This commit is contained in:
Patrick Hellebrand
2021-09-23 14:54:25 +02:00
parent 7a273f7fdc
commit 15679951bc

View File

@@ -213,27 +213,13 @@ namespace PolyChat
private void OnKeyUp(object sender, Windows.UI.Xaml.Input.KeyRoutedEventArgs e) private void OnKeyUp(object sender, Windows.UI.Xaml.Input.KeyRoutedEventArgs e)
{ {
updateSendButtonEnabled(); updateSendButtonEnabled();
if (e.Key == Windows.System.VirtualKey.Enter) if (buttonSend.IsEnabled && e.Key == Windows.System.VirtualKey.Enter)
{ {
OnSendMessage(); OnSendMessage();
} }
} }
public static IAsyncOperation<ContentDialogResult> SafelyOpenDialog(Dialog d) public static IAsyncOperation<ContentDialogResult> SafelyOpenDialog(ContentDialog d)
{
if(VisualTreeHelper.GetOpenPopups(Window.Current).Count == 0)
return d.ShowAsync();
return null;
}
public static IAsyncOperation<ContentDialogResult> SafelyOpenDialog(NewChatDialog d)
{
if (VisualTreeHelper.GetOpenPopups(Window.Current).Count == 0)
return d.ShowAsync();
return null;
}
public static IAsyncOperation<ContentDialogResult> SafelyOpenDialog(EditUsernameDialog d)
{ {
if(VisualTreeHelper.GetOpenPopups(Window.Current).Count == 0) if(VisualTreeHelper.GetOpenPopups(Window.Current).Count == 0)
return d.ShowAsync(); return d.ShowAsync();