Skip to content

Commit

Permalink
shell: Fix bugs found by TypeScript
Browse files Browse the repository at this point in the history
The cockpit.spawn function takes only two arguments (unlike
cockpit.script).

Location.reload() doesn't take any arguments, the "force_reload"
argument is a Firefox extension.

There is no "this.onSelect".
  • Loading branch information
mvollmer committed Dec 17, 2024
1 parent 8f057bb commit fd0927e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/shell/nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ export class CockpitNav extends React.Component {
return (
<>
<SearchInput placeholder={_("Search")} value={this.state.search} onChange={(_, search) => this.setState({ search })} onClear={() => this.setState({ search: "" })} className="search" />
<Nav onSelect={this.onSelect} theme="dark">
<Nav theme="dark">
{ groups.map(g =>
<section className="pf-v5-c-nav__section" aria-labelledby={"section-title-" + g.name} key={g.name}>
<div className="nav-group-heading">
Expand Down
2 changes: 1 addition & 1 deletion pkg/shell/shell-modals.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const AboutCockpitModal = ({ dialogResult }) => {
useInit(() => {
const packages = [];
const cmd = "(set +e; rpm -qa --qf '%{NAME} %{VERSION}\\n'; dpkg-query -f '${Package} ${Version}\n' --show; pacman -Q) 2> /dev/null | grep cockpit | sort";
cockpit.spawn(["bash", "-c", cmd], [], { err: "message" })
cockpit.spawn(["bash", "-c", cmd], { err: "message" })
.then(pkgs =>
pkgs.trim().split("\n")
.forEach(p => {
Expand Down

0 comments on commit fd0927e

Please sign in to comment.