removed ability to send empty messages

This commit is contained in:
Patrick Hellebrand
2021-09-23 14:54:25 +02:00
committed by Felix Hartmann (PEA3-Fe-FI)
parent 5ce1316245
commit 4c0413e7d8

View File

@@ -217,33 +217,19 @@ namespace PolyChat
private void OnKeyUp(object sender, Windows.UI.Xaml.Input.KeyRoutedEventArgs e)
{
updateSendButtonEnabled();
if (e.Key == Windows.System.VirtualKey.Enter)
if (buttonSend.IsEnabled && e.Key == Windows.System.VirtualKey.Enter)
{
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)
return d.ShowAsync();
return null;
}
// UPDATE FUNCTIONS FOR UI PLACEHOLDERS
private void updateNoChatsPlaceholder()