diff --git a/src/pages/plugin/plugin.js b/src/pages/plugin/plugin.js index c5be9e394..f4fb544f5 100644 --- a/src/pages/plugin/plugin.js +++ b/src/pages/plugin/plugin.js @@ -73,13 +73,25 @@ export default async function PluginInclude( try { if (installed) { - const installedPlugin = await fsOperation( - Url.join(PLUGIN_DIR, id, "plugin.json"), - ).readFile("json"); + const manifest = Url.join(PLUGIN_DIR, id, "plugin.json"); + const installedPlugin = await fsOperation(manifest) + .readFile("json") + .catch((err) => { + alert(`Failed to load plugin metadata: ${manifest}`); + console.error(err); + }); const { author } = installedPlugin; - const description = await fsOperation( - Url.join(PLUGIN_DIR, id, installedPlugin.readme), - ).readFile("utf8"); + const readme = Url.join( + PLUGIN_DIR, + id, + installedPlugin.readme || "readme.md", + ); + const description = await fsOperation(readme) + .readFile("utf8") + .catch((err) => { + alert(`Failed to load plugin readme: ${readme}`); + console.error(err); + }); let changelogs = ""; if (installedPlugin.changelogs) { const changelogPath = Url.join( @@ -163,7 +175,7 @@ export default async function PluginInclude( } } } catch (error) { - console.log(error); + console.error(error); } finally { loader.removeTitleLoader(); } @@ -177,7 +189,7 @@ export default async function PluginInclude( $button?.click(); } } catch (err) { - console.log(err); + console.error(err); helpers.error(err); } finally { loader.removeTitleLoader(); diff --git a/src/pages/plugins/plugins.scss b/src/pages/plugins/plugins.scss index a62c4a3bb..4e5ce113b 100644 --- a/src/pages/plugins/plugins.scss +++ b/src/pages/plugins/plugins.scss @@ -1,7 +1,6 @@ #plugins { display: flex; flex-direction: column; - height: 100%; .filter-message { font-size: 0.9rem; @@ -39,7 +38,7 @@ .list { overflow-y: auto; padding: 0.5rem 0; - + &:empty::after { content: attr(empty-msg); display: flex; @@ -517,5 +516,4 @@ } } } - -} +} \ No newline at end of file