File tree Expand file tree Collapse file tree 4 files changed +4
-42
lines changed
Expand file tree Collapse file tree 4 files changed +4
-42
lines changed Original file line number Diff line number Diff line change 77using System ;
88using System . Collections . Generic ;
99using System . IO ;
10- using System . Linq ;
1110using System . Threading . Tasks ;
1211
1312namespace Core . Api
@@ -160,23 +159,12 @@ public IActionResult Delete(string id)
160159 List < ThemeItem > GetThemes ( )
161160 {
162161 var themes = new List < ThemeItem > ( ) ;
163- var combined = new List < string > ( ) ;
162+ var themeList = _store . GetThemes ( ) ;
164163
165- var storageThemes = _store . GetThemes ( ) ;
166-
167- if ( storageThemes != null )
168- combined . AddRange ( storageThemes ) ;
169-
170- if ( AppConfig . EmbeddedThemes != null )
171- combined . AddRange ( AppConfig . EmbeddedThemes ) ;
172-
173- combined = combined . Distinct ( ) . ToList ( ) ;
174- combined . Sort ( ) ;
175-
176- if ( combined != null && combined . Count > 0 )
164+ if ( themeList != null && themeList . Count > 0 )
177165 {
178166 var current = new ThemeItem ( ) ;
179- foreach ( var themeTitle in combined )
167+ foreach ( var themeTitle in themeList )
180168 {
181169 var theme = themeTitle . ToLower ( ) ;
182170 var slash = Path . DirectorySeparatorChar . ToString ( ) ;
Original file line number Diff line number Diff line change @@ -8,8 +8,6 @@ namespace Core
88{
99 public static class AppConfig
1010 {
11- public static IList < string > EmbeddedThemes { get ; set ; }
12-
1311 public static IEnumerable < Assembly > GetAssemblies ( bool includeApp = false )
1412 {
1513 var assemblies = new List < Assembly > ( ) ;
Original file line number Diff line number Diff line change 22
33 <PropertyGroup >
44 <TargetFramework >netcoreapp2.2</TargetFramework >
5- <Version >2.4.1.4 </Version >
5+ <Version >2.4.1.5 </Version >
66 </PropertyGroup >
77
88 <PropertyGroup Condition =" '$(Configuration)|$(Platform)'=='Debug|AnyCPU'" >
Original file line number Diff line number Diff line change @@ -53,30 +53,6 @@ static void AddFileProviders(IServiceCollection services)
5353 foreach ( var assembly in AppConfig . GetAssemblies ( true ) )
5454 {
5555 var fileProvider = new EmbeddedFileProvider ( assembly , assembly . GetName ( ) . Name ) ;
56-
57- // load themes from embedded provider
58- var content = fileProvider . GetDirectoryContents ( "" ) ;
59- if ( content . Exists )
60- {
61- foreach ( var item in content )
62- {
63- if ( item . Name . StartsWith ( "Views.Themes" ) )
64- {
65- if ( AppConfig . EmbeddedThemes == null )
66- AppConfig . EmbeddedThemes = new List < string > ( ) ;
67-
68- var ar = item . Name . Split ( '.' ) ;
69- if ( ar . Length > 2 && ! AppConfig . EmbeddedThemes . Contains ( ar [ 2 ] ) )
70- {
71- if ( assembly . GetName ( ) . Name . ToLower ( ) != "app" )
72- {
73- AppConfig . EmbeddedThemes . Add ( ar [ 2 ] ) ;
74- }
75- }
76- }
77- }
78- }
79-
8056 options . FileProviders . Add ( fileProvider ) ;
8157 }
8258 } ) ;
You can’t perform that action at this time.
0 commit comments