delete chat only on explicit button press, not on disconnect, dialog opening fixed

This commit is contained in:
Felix Hartmann (PEA3-Fe-FI)
2021-09-23 14:50:35 +02:00
parent ac67ff38c6
commit f55c4a2b70
4 changed files with 34 additions and 31 deletions

View File

@@ -50,26 +50,27 @@ namespace PolyChat
await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
{
Dialog dialog = new Dialog(
Dialog.TYPE_ERROR,
heading,
message,
new DialogButton(
"Retry",
() =>
{
Controller.Connect(param);
Partners.Add(new ChatPartner(
"Connecting...",
param
));
updateNoChatsPlaceholder();
}
),
new DialogButton(
"Ignore",
() => { /* do nothing */ }
)
);
Dialog.TYPE_ERROR,
heading,
message,
new DialogButton(
"Retry",
() =>
{
Controller.Connect(param);
Partners.Add(new ChatPartner(
"Connecting...",
param
));
updateNoChatsPlaceholder();
}
),
new DialogButton(
"Ignore",
() => { /* do nothing */ }
)
);
SafelyOpenDialog(dialog);
});
}
@@ -188,7 +189,7 @@ namespace PolyChat
private void OnDeleteChat(object sender = null, RoutedEventArgs e = null)
{
Controller.CloseChat(selectedPartner.Code);
Controller.CloseChat(selectedPartner.Code,delete: true);
Partners.Remove(selectedPartner);
updateNoChatsPlaceholder();
updateNoChatSelected();