Skip to content

Commit

Permalink
删除旧版动态页
Browse files Browse the repository at this point in the history
  • Loading branch information
ywmoyue committed Apr 27, 2024
1 parent 1d18b47 commit fd7cf0e
Show file tree
Hide file tree
Showing 7 changed files with 337 additions and 674 deletions.
13 changes: 3 additions & 10 deletions src/BiliLite.UWP/BiliLite.UWP.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@
<Compile Include="Models\Common\User\SendDynamic\RcmdTopicModel.cs" />
<Compile Include="Models\Functions\IShortcutFunction.cs" />
<Compile Include="Models\Functions\RefreshShortcutFunction.cs" />
<Compile Include="Pages\Home\UserDynamicAllPage.xaml.cs">
<DependentUpon>UserDynamicAllPage.xaml</DependentUpon>
<Compile Include="Pages\Home\UserDynamicPage.xaml.cs">
<DependentUpon>UserDynamicPage.xaml</DependentUpon>
</Compile>
<Compile Include="Pages\IMainPage.cs" />
<Compile Include="Pages\IRefreshablePage.cs" />
Expand Down Expand Up @@ -743,9 +743,6 @@
<Compile Include="Pages\Home\RecommendPage.xaml.cs">
<DependentUpon>RecommendPage.xaml</DependentUpon>
</Compile>
<Compile Include="Pages\Home\UserDynamicPage.xaml.cs">
<DependentUpon>UserDynamicPage.xaml</DependentUpon>
</Compile>
<Compile Include="Pages\LiveDetailPage.xaml.cs">
<DependentUpon>LiveDetailPage.xaml</DependentUpon>
</Compile>
Expand Down Expand Up @@ -991,7 +988,7 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Pages\Home\UserDynamicAllPage.xaml">
<Page Include="Pages\Home\UserDynamicPage.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
Expand Down Expand Up @@ -1147,10 +1144,6 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Pages\Home\UserDynamicPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Pages\LiveDetailPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
Expand Down
46 changes: 36 additions & 10 deletions src/BiliLite.UWP/Models/Common/Home/DefaultHomeNavItems.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
using BiliLite.Services;
using System;
using BiliLite.Services;
using System.Collections.Generic;
using System.Linq;
using Newtonsoft.Json;

namespace BiliLite.Models.Common.Home
{
public static class DefaultHomeNavItems
{
private static readonly ILogger _logger = GlobalLogger.FromCurrentType();

public static List<HomeNavItem> CheckHomeNavItems(List<HomeNavItem> navList)
{
var defaultItems = GetDefaultHomeNavItems();
Expand All @@ -21,6 +25,36 @@ public static List<HomeNavItem> CheckHomeNavItems(List<HomeNavItem> navList)
return result;
}

public static List<HomeNavItem> GetHomeNavItems()
{
var homeNavItemList = new List<HomeNavItem>();
var tempHomeNavItemList = SettingService.GetValue<List<object>>(SettingConstants.UI.HOEM_ORDER,
null);

if (tempHomeNavItemList == null)
{
homeNavItemList = DefaultHomeNavItems.GetDefaultHomeNavItems();
return homeNavItemList;
}
else
{
foreach (var item in tempHomeNavItemList)
{
try
{
var navItem = JsonConvert.DeserializeObject<HomeNavItem>(JsonConvert.SerializeObject(item));
homeNavItemList.Add(navItem);
}
catch (Exception ex)
{
_logger.Warn(ex.Message, ex);
}
}
}
homeNavItemList = DefaultHomeNavItems.CheckHomeNavItems(homeNavItemList);
return homeNavItemList;
}

public static List<HomeNavItem> GetDefaultHomeNavItems()
{
return new List<HomeNavItem>()
Expand All @@ -44,7 +78,7 @@ public static List<HomeNavItem> GetDefaultHomeNavItems()
new HomeNavItem()
{
Icon = FontAwesome5.EFontAwesomeIcon.Solid_Heart,
Page = typeof(Pages.Home.UserDynamicAllPage),
Page = typeof(Pages.Home.UserDynamicPage),
Title = "动态",
NeedLogin = true,
Show = false
Expand Down Expand Up @@ -161,14 +195,6 @@ public static List<HomeNavItem> GetDefaultHideHomeNavItems()
NeedLogin = true,
Show = false
},
new HomeNavItem()
{
Icon = FontAwesome5.EFontAwesomeIcon.Solid_Heart,
Page = typeof(Pages.Home.UserDynamicPage),
Title = "动态(旧版)",
NeedLogin = true,
Show = false
},
};
}
}
Expand Down
211 changes: 0 additions & 211 deletions src/BiliLite.UWP/Pages/Home/UserDynamicAllPage.xaml

This file was deleted.

Loading

0 comments on commit fd7cf0e

Please sign in to comment.