File tree Expand file tree Collapse file tree 2 files changed +22
-12
lines changed
Expand file tree Collapse file tree 2 files changed +22
-12
lines changed Original file line number Diff line number Diff line change @@ -73,13 +73,25 @@ export default async function PluginInclude(
7373
7474 try {
7575 if ( installed ) {
76- const installedPlugin = await fsOperation (
77- Url . join ( PLUGIN_DIR , id , "plugin.json" ) ,
78- ) . readFile ( "json" ) ;
76+ const manifest = Url . join ( PLUGIN_DIR , id , "plugin.json" ) ;
77+ const installedPlugin = await fsOperation ( manifest )
78+ . readFile ( "json" )
79+ . catch ( ( err ) => {
80+ alert ( `Failed to load plugin metadata: ${ manifest } ` ) ;
81+ console . error ( err ) ;
82+ } ) ;
7983 const { author } = installedPlugin ;
80- const description = await fsOperation (
81- Url . join ( PLUGIN_DIR , id , installedPlugin . readme ) ,
82- ) . readFile ( "utf8" ) ;
84+ const readme = Url . join (
85+ PLUGIN_DIR ,
86+ id ,
87+ installedPlugin . readme || "readme.md" ,
88+ ) ;
89+ const description = await fsOperation ( readme )
90+ . readFile ( "utf8" )
91+ . catch ( ( err ) => {
92+ alert ( `Failed to load plugin readme: ${ readme } ` ) ;
93+ console . error ( err ) ;
94+ } ) ;
8395 let changelogs = "" ;
8496 if ( installedPlugin . changelogs ) {
8597 const changelogPath = Url . join (
@@ -163,7 +175,7 @@ export default async function PluginInclude(
163175 }
164176 }
165177 } catch ( error ) {
166- console . log ( error ) ;
178+ console . error ( error ) ;
167179 } finally {
168180 loader . removeTitleLoader ( ) ;
169181 }
@@ -177,7 +189,7 @@ export default async function PluginInclude(
177189 $button ?. click ( ) ;
178190 }
179191 } catch ( err ) {
180- console . log ( err ) ;
192+ console . error ( err ) ;
181193 helpers . error ( err ) ;
182194 } finally {
183195 loader . removeTitleLoader ( ) ;
Original file line number Diff line number Diff line change 11#plugins {
22 display : flex ;
33 flex-direction : column ;
4- height : 100% ;
54
65 .filter-message {
76 font-size : 0.9rem ;
3938 .list {
4039 overflow-y : auto ;
4140 padding : 0.5rem 0 ;
42-
41+
4342 & :empty ::after {
4443 content : attr (empty-msg );
4544 display : flex ;
517516 }
518517 }
519518 }
520-
521- }
519+ }
You can’t perform that action at this time.
0 commit comments