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,33 +213,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()