Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: dungeons error #2232

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
import credentials from "./credentials.js";
import { SkyCryptError } from "./constants/error.js";

const __dirname = path.dirname(fileURLToPath(import.meta.url));

Check warning on line 44 in src/helper.js

View workflow job for this annotation

GitHub Actions / check linting (es-lint)

Variable name `__dirname` must match one of the following formats: camelCase, UPPER_CASE
const hypixel = axios.create({
baseURL: "https://api.hypixel.net/",
});
Expand Down Expand Up @@ -664,6 +664,10 @@
const lore = [];
const stats = [];

if (!GEMSTONES[type.toUpperCase()]) {
return "§c§oMISSING GEMSTONE DATA§r";
}

// Gem color
const color = `§${GEMSTONES[type.toUpperCase()].color}`;

Expand Down
24 changes: 11 additions & 13 deletions views/sections/stats/dungeons.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,20 @@ function formatDungeonStat(stat, type) {
<a class="stat-anchor" id="Dungeons"></a>
<h2 class="stat-header">Dungeons</h2>
<div class="stat-content">
<% if (calculated.dungeons.catacombs.visited === false) { %>
<% if (!calculated.dungeons.catacombs?.visited) { %>
<p class="stat-raw-values">
<%= calculated.display_name %> hasn't entered a dungeon yet.
</p>
<% } else { %>
<% if (calculated.dungeons.catacombs.visited) { %>
<div class="skill-bars">
<skill-component skill="catacombs" type="dungeon" icon="<%= skillItems.catacombs %>"></skill-component>

<skill-component skill="healer" type="dungeon_class" icon="<%= skillItems.healer %>"></skill-component>
<skill-component skill="mage" type="dungeon_class" icon="<%= skillItems.mage %>"></skill-component>
<skill-component skill="berserk" type="dungeon_class" icon="<%= skillItems.berserk %>"></skill-component>
<skill-component skill="archer" type="dungeon_class" icon="<%= skillItems.archer %>"></skill-component>
<skill-component skill="tank" type="dungeon_class" icon="<%= skillItems.tank %>"></skill-component>
</div>
<% } %>
<div class="skill-bars">
<skill-component skill="catacombs" type="dungeon" icon="<%= skillItems.catacombs %>"></skill-component>

<skill-component skill="healer" type="dungeon_class" icon="<%= skillItems.healer %>"></skill-component>
<skill-component skill="mage" type="dungeon_class" icon="<%= skillItems.mage %>"></skill-component>
<skill-component skill="berserk" type="dungeon_class" icon="<%= skillItems.berserk %>"></skill-component>
<skill-component skill="archer" type="dungeon_class" icon="<%= skillItems.archer %>"></skill-component>
<skill-component skill="tank" type="dungeon_class" icon="<%= skillItems.tank %>"></skill-component>
</div>

<p class="stat-raw-values" style="margin: 20px 0;">
<!-- Selected Class-->
Expand Down Expand Up @@ -156,7 +154,7 @@ function formatDungeonStat(stat, type) {
<% if (calculated.dungeons.master_catacombs !== undefined) { %>
<p class="stat-sub-header">Master Catacombs</p>

<% if (calculated.dungeons.master_catacombs.visited === false) { %>
<% if (!calculated.dungeons.master_catacombs?.visited) { %>
<p class="stat-raw-values"><%= calculated.display_name %> hasn't completed any Master Catacombs floor yet.</p>
<% } else { %>
<div class="floor-containers narrow-info-container-wrapper">
Expand Down
Loading