File tree Expand file tree Collapse file tree 3 files changed +6
-6
lines changed
Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -30,8 +30,6 @@ public override void OnFrameworkInitializationCompleted()
3030 Resources [ "ErrorBg" ] = Brush . Parse ( SettingProvider . Current . ColorErrorBg ) ;
3131 Resources [ "OkBg" ] = Brush . Parse ( SettingProvider . Current . ColorOkBg ) ;
3232
33- _ = BangumiDataProvider . LoadBangumiDataObject ( ) ;
34-
3533 CommonUtils . CleanUpTempFolder ( ) ;
3634
3735 if ( SettingProvider . Current . CheckUpdateOnStartup )
Original file line number Diff line number Diff line change @@ -12,12 +12,12 @@ public SubjectFlyoutView()
1212 {
1313 this . WhenAnyValue ( x => x . ViewModel )
1414 . WhereNotNull ( )
15- . Subscribe ( vm =>
15+ . Subscribe ( async vm =>
1616 {
1717 if ( vm . Id is int id && id != initializedItem )
1818 {
1919 initializedItem = id ;
20- OpenInBrowserSplitButton . Flyout = SubjectView . GetOpenInBrowserFlyout ( id ) ;
20+ OpenInBrowserSplitButton . Flyout = await SubjectView . GetOpenInBrowserFlyout ( id ) ;
2121 }
2222 } ) . DisposeWith ( disposables ) ;
2323 } ) ;
Original file line number Diff line number Diff line change @@ -39,13 +39,15 @@ public SubjectView()
3939 vm . CommentListViewModel ? . LoadPageCommand . Execute ( 1 ) . Subscribe ( ) ;
4040 vm . SubjectCollectionViewModel = await ApiC . GetViewModelAsync < SubjectCollectionViewModel > ( vm . Id ) ;
4141 vm . SubjectCollectionViewModel ? . Parent = ViewModel ;
42- OpenInBrowserSplitButton . Flyout = GetOpenInBrowserFlyout ( ( int ) vm . Id ! ) ;
42+ OpenInBrowserSplitButton . Flyout = await GetOpenInBrowserFlyout ( ( int ) vm . Id ! ) ;
4343 } ) . DisposeWith ( disposables ) ;
4444 } ) ;
4545 }
4646
47- public static MenuFlyout ? GetOpenInBrowserFlyout ( int id )
47+ public static async Task < MenuFlyout ? > GetOpenInBrowserFlyout ( int id )
4848 {
49+ await BangumiDataProvider . LoadBangumiDataObject ( ) ;
50+
4951 if ( BangumiDataProvider . BangumiDataObject ? . Items . LastOrDefault ( item =>
5052 {
5153 if ( item . Sites . Length == 0 ) return false ;
You can’t perform that action at this time.
0 commit comments