File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed
src/GitLab.VisualStudio/Services Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -114,9 +114,9 @@ private void SaveUserToLocal(User user)
114
114
System . IO . File . WriteAllText ( _path , Newtonsoft . Json . JsonConvert . SerializeObject ( user ) ) ;
115
115
user . PrivateToken = pt ;
116
116
}
117
- catch ( Exception )
117
+ catch ( Exception )
118
118
{
119
-
119
+
120
120
}
121
121
}
122
122
@@ -144,11 +144,13 @@ private User LoadUser()
144
144
try
145
145
{
146
146
var _path = System . IO . Path . Combine ( Environment . GetFolderPath ( Environment . SpecialFolder . UserProfile ) , $ "{ new Uri ( Host ) . Host } .gitlab4vs") ;
147
- if ( System . IO . File . Exists ( _path ) )
147
+ if ( ! System . IO . File . Exists ( _path ) )
148
148
{
149
- _user = Newtonsoft . Json . JsonConvert . DeserializeObject < User > ( System . IO . File . ReadAllText ( _path ) ) ;
150
- _user . PrivateToken = GetToken ( _user . Host ) ;
149
+ _path = System . IO . Path . Combine ( Environment . GetFolderPath ( Environment . SpecialFolder . UserProfile ) , $ "{ new Uri ( Strings . DefaultHost ) . Host } .gitlab4vs") ;
151
150
}
151
+
152
+ _user = Newtonsoft . Json . JsonConvert . DeserializeObject < User > ( System . IO . File . ReadAllText ( _path ) ) ;
153
+ _user . PrivateToken = GetToken ( _user . Host ) ;
152
154
}
153
155
catch ( Exception ex )
154
156
{
@@ -222,11 +224,11 @@ public bool HaveHost(string host)
222
224
}
223
225
result = HostVersionInfo . ContainsKey ( host ) ;
224
226
225
- if ( ! result && Uri . TryCreate ( host , UriKind . Absolute , out Uri uri ) )
227
+ if ( ! result && Uri . TryCreate ( host , UriKind . Absolute , out Uri uri ) )
226
228
{
227
229
result = HostVersionInfo . ContainsKey ( uri . Host ) ;
228
230
}
229
-
231
+
230
232
return result ;
231
233
}
232
234
You can’t perform that action at this time.
0 commit comments