@@ -35,6 +35,7 @@ public NetworkDrivesManager()
35
35
{
36
36
var networkItem = new DriveItem ( )
37
37
{
38
+ DeviceID = "network-folder" ,
38
39
Text = "Network" . GetLocalized ( ) ,
39
40
Path = App . AppSettings . NetworkFolderPath ,
40
41
Type = DriveType . Network ,
@@ -112,7 +113,7 @@ await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPrio
112
113
MainPage . SideBarItems . BeginBulkOperation ( ) ;
113
114
114
115
var section = MainPage . SideBarItems . FirstOrDefault ( x => x . Text == "SidebarNetworkDrives" . GetLocalized ( ) ) as LocationItem ;
115
- if ( section == null )
116
+ if ( section == null && this . drivesList . Any ( d => d . DeviceID != "network-folder" ) )
116
117
{
117
118
section = new LocationItem ( )
118
119
{
@@ -125,13 +126,16 @@ await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPrio
125
126
MainPage . SideBarItems . Add ( section ) ;
126
127
}
127
128
128
- foreach ( var drive in Drives . ToList ( )
129
+ if ( section != null )
130
+ {
131
+ foreach ( var drive in Drives . ToList ( )
129
132
. OrderByDescending ( o => string . Equals ( o . Text , "Network" . GetLocalized ( ) , StringComparison . OrdinalIgnoreCase ) )
130
133
. ThenBy ( o => o . Text ) )
131
- {
132
- if ( ! section . ChildItems . Contains ( drive ) )
133
134
{
134
- section . ChildItems . Add ( drive ) ;
135
+ if ( ! section . ChildItems . Contains ( drive ) )
136
+ {
137
+ section . ChildItems . Add ( drive ) ;
138
+ }
135
139
}
136
140
}
137
141
0 commit comments