File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -65,6 +65,14 @@ public bool ThreadListAlignRight
65
65
66
66
public void AddThread ( SignalConversation contact )
67
67
{
68
+ // only add a contact to Threads if it isn't already there
69
+ foreach ( var thread in Threads )
70
+ {
71
+ if ( thread . ThreadId == contact . ThreadId )
72
+ {
73
+ return ;
74
+ }
75
+ }
68
76
Threads . Add ( contact ) ;
69
77
ThreadsDictionary [ contact . ThreadId ] = contact ;
70
78
}
@@ -186,6 +194,12 @@ await Windows.ApplicationModel.Core.CoreApplication.MainView.CoreWindow.Dispatch
186
194
Debug . WriteLine ( "Init lock released" ) ;
187
195
}
188
196
197
+ public async Task OnNavigatingFrom ( )
198
+ {
199
+ SelectedThread = null ;
200
+ View . Thread . DisposeCurrentThread ( ) ;
201
+ }
202
+
189
203
public async Task Shutdown ( )
190
204
{
191
205
Running = false ;
Original file line number Diff line number Diff line change @@ -93,6 +93,13 @@ protected override async void OnNavigatedTo(NavigationEventArgs e)
93
93
await Vm . Init ( ) ;
94
94
}
95
95
96
+ protected override async void OnNavigatingFrom ( NavigatingCancelEventArgs e )
97
+ {
98
+ base . OnNavigatingFrom ( e ) ;
99
+ ContactsList . SelectedItem = null ;
100
+ await Vm . OnNavigatingFrom ( ) ;
101
+ }
102
+
96
103
private void Frame_SizeChanged ( object sender , SizeChangedEventArgs e )
97
104
{
98
105
var oldStyle = Utils . GetViewStyle ( e . PreviousSize ) ;
You can’t perform that action at this time.
0 commit comments