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 custom methods component #90

Merged
merged 1 commit into from
Nov 12, 2024
Merged
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
6 changes: 3 additions & 3 deletions src/components/table.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function Table({ Category, Title, search, grid }) {

useEffect(() => {
if (!search) {
setRegion(window.location.pathname.slice(1,-1));
setRegion(window.location.pathname.slice(1, -1));
const region = window.location.pathname.slice(1);
fetch(`${API_URL}/${region || 'int/'}${Category}.json`,
{ cache: 'force-cache' }).
Expand Down Expand Up @@ -50,7 +50,7 @@ function Table({ Category, Title, search, grid }) {
<div>Software</div>
</div>
{entries.map(([name, data]) => (
<Entry name={name.replace(` [${region.toUpperCase()}]`, '')} data={data}/>
<Entry name={name.replace(` [${region.toUpperCase()}]`, '')} data={data} />
))}
</div>
);
Expand Down Expand Up @@ -144,7 +144,7 @@ function Methods({ methods, customSoftware, customHardware }) {
* @param {string[]} props.methods - The custom methods
*/
function CustomMethods({ type, methods }) {
return methods.length !== 0 ?
return methods ?
<span class={`icon-info custom-${type}-popover`} data-bs-content={methods.map((method) => `<li>${method}</li>`).join("")} data-bs-toggle="popover"></span>
: <span class="icon-info" title={`Requires proprietary ${type === "hardware" ? "hardware token" : "app/software"}`}></span>;
}
Expand Down