File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change 1010using System . Linq ;
1111using System . Net . Http ;
1212using System . Reflection ;
13- using System . Threading . Tasks ;
1413using System . Windows . Forms ;
1514
1615namespace WinDynamicDesktop
@@ -61,7 +60,7 @@ public static void Initialize()
6160 }
6261 else
6362 {
64- LoadLocaleFromWeb ( ) . Wait ( ) ;
63+ LoadLocaleFromWeb ( ) ;
6564 }
6665
6766 if ( JsonConfig . firstRun )
@@ -146,7 +145,7 @@ public static void NotifyIfTestMode()
146145 }
147146 }
148147
149- private static async Task LoadLocaleFromWeb ( )
148+ private static void LoadLocaleFromWeb ( )
150149 {
151150 var client = new RestClient ( "https://api.poeditor.com" ) ;
152151
@@ -156,15 +155,15 @@ private static async Task LoadLocaleFromWeb()
156155 request . AddParameter ( "language" , currentLocale ) ;
157156 request . AddParameter ( "type" , "mo" ) ;
158157
159- var response = await client . ExecuteAsync < PoEditorApiData > ( request ) ;
158+ var response = client . Execute < PoEditorApiData > ( request ) ;
160159 if ( ! response . IsSuccessful )
161160 {
162161 return ;
163162 }
164163
165164 using ( HttpClient httpClient = new HttpClient ( ) )
166165 {
167- byte [ ] moBinary = await httpClient . GetByteArrayAsync ( response . Data . result . url ) ;
166+ byte [ ] moBinary = httpClient . GetByteArrayAsync ( response . Data . result . url ) . Result ;
168167
169168 using ( Stream stream = new MemoryStream ( moBinary ) )
170169 {
You can’t perform that action at this time.
0 commit comments