Bug fixes for selected cell plugin list

This commit is contained in:
Tyler Hallada 2022-03-10 01:10:14 -05:00
parent cc625d9029
commit ae6b3bff12
3 changed files with 7 additions and 2 deletions

View File

@ -121,7 +121,6 @@ const CellData: React.FC<Props> = ({ selectedCell, counts }) => {
<span>{data.plugins_count}</span>
</li>
</ul>
<h2>Loaded Plugins</h2>
<PluginList selectedCell={selectedCell} />
<CellModList mods={data.mods} counts={counts} />
</>

View File

@ -297,6 +297,7 @@ const Map: React.FC = () => {
clearSelectedCell();
}
} else if (router.query.plugin && typeof router.query.plugin === "string") {
clearSelectedCell();
clearSelectedCells();
setSidebarOpen(true);
if (plugins && plugins.length > 0 && pluginsPending === 0) {

View File

@ -16,7 +16,11 @@ const PluginsList: React.FC<Props> = ({ selectedCell }) => {
selectedCell
? state.plugins.plugins.filter((plugin) =>
plugin.parsed?.cells.some(
(cell) => cell.x === selectedCell.x && cell.y === selectedCell.y
(cell) =>
cell.x === selectedCell.x &&
cell.y === selectedCell.y &&
// TODO: support other worlds
cell.world_form_id === 60
)
)
: state.plugins.plugins
@ -25,6 +29,7 @@ const PluginsList: React.FC<Props> = ({ selectedCell }) => {
return (
<>
{selectedCell && plugins.length > 0 && <h2>Loaded Plugins</h2>}
<ol className={styles["plugin-list"]}>
{plugins.map((plugin) => (
<li key={plugin.filename} title={plugin.filename}>