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 7a273f7fdc
commit 4e60fd2bdb
5 changed files with 35 additions and 33 deletions

View File

@@ -46,26 +46,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);
});
}
@@ -184,7 +185,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();