Skip to content

Commit

Permalink
Fix develop lime app minor bugs (#406)
Browse files Browse the repository at this point in the history
* fix(landing): fix first boot login error

* fix(landing): fix most_active_iface

Fix #378

* fix(landing): fix voucher list page

* fix(landing): delete console.log
  • Loading branch information
selankon authored Mar 12, 2024
1 parent 48f415b commit 3f76176
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 25 deletions.
46 changes: 25 additions & 21 deletions plugins/lime-plugin-pirania/src/screens/voucherList.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,27 +20,31 @@ const VoucherList = () => {

if (loadingBoardData || loadingVouchers) return <Loading />;

const filteredVoucher = vouchers
.sort((a, b) => {
return parseInt(a.creation_date, 10) < parseInt(b.creation_date, 10)
? 1
: -1;
})
.filter((voucher) => {
if (filterSelection === "all-vouchers") return true;
if (filterSelection === "created-in-this-node") {
return voucher.author_node === boardData.hostname;
}
return voucher.status === filterSelection;
})
.filter((voucher) => {
if (!search || search === "") return true;
const withName = voucher.name.includes(search);
const withNode = voucher.author_node?.includes(search);
const withId = voucher.id.includes(search);
const withCode = voucher.code.includes(search);
if (withName || withNode || withId || withCode) return true;
});
let filteredVoucher = [];
if (vouchers) {
filteredVoucher = vouchers
.sort((a, b) => {
return parseInt(a.creation_date, 10) <
parseInt(b.creation_date, 10)
? 1
: -1;
})
.filter((voucher) => {
if (filterSelection === "all-vouchers") return true;
if (filterSelection === "created-in-this-node") {
return voucher.author_node === boardData.hostname;
}
return voucher.status === filterSelection;
})
.filter((voucher) => {
if (!search || search === "") return true;
const withName = voucher.name.includes(search);
const withNode = voucher.author_node?.includes(search);
const withId = voucher.id.includes(search);
const withCode = voucher.code.includes(search);
if (withName || withNode || withId || withCode) return true;
});
}

return (
<div className="d-flex flex-column flex-grow-1">
Expand Down
7 changes: 4 additions & 3 deletions plugins/lime-plugin-rx/src/rxPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,14 @@ const SystemBox = ({ uptime, firmwareVersion, boardModel }) => {
};

const MostActiveBox = ({ node, changeNode }) => {
const use_most_active = !!node.most_active?.iface;
const { data: bathost } = useBatHost(
node.most_active && node.most_active.station_mac,
node.most_active && node.most_active.iface,
node.most_active?.station_mac,
node.most_active?.iface,
{ enabled: !!node.most_active }
);

if (node.most_active === undefined) {
if (!use_most_active) {
return <span />;
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const App = () => {
const { data: session } = useSession();
const { mutate: login } = useLogin();
const { data: boardData } = useBoardData({
enabled: session && session.username !== undefined,
enabled: session?.username != null,
});

useEffect(() => {
Expand Down

0 comments on commit 3f76176

Please sign in to comment.