Skip to content

Commit fdf8dfc

Browse files
deadlyjackAjit Kumar
andauthored
fix(plugins page scrolling) (#1505)
Co-authored-by: Ajit Kumar <dellevenjack@gmail>
1 parent 1b8009d commit fdf8dfc

File tree

2 files changed

+22
-12
lines changed

2 files changed

+22
-12
lines changed

src/pages/plugin/plugin.js

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff 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();

src/pages/plugins/plugins.scss

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#plugins {
22
display: flex;
33
flex-direction: column;
4-
height: 100%;
54

65
.filter-message {
76
font-size: 0.9rem;
@@ -39,7 +38,7 @@
3938
.list {
4039
overflow-y: auto;
4140
padding: 0.5rem 0;
42-
41+
4342
&:empty::after {
4443
content: attr(empty-msg);
4544
display: flex;
@@ -517,5 +516,4 @@
517516
}
518517
}
519518
}
520-
521-
}
519+
}

0 commit comments

Comments
 (0)