Skip to content

Commit

Permalink
Prefer using the Promise API
Browse files Browse the repository at this point in the history
  • Loading branch information
jelly authored and martinpitt committed Mar 26, 2024
1 parent cfe4a9c commit 8153ef8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/app.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ class Application extends React.Component {
componentDidMount() {
this.init(true);
cockpit.script("[ `id -u` -eq 0 ] || echo $XDG_RUNTIME_DIR")
.done(xrd => {
.then(xrd => {
const isRoot = !xrd || xrd.split("/").pop() == "root";
if (!isRoot) {
sessionStorage.setItem('XDG_RUNTIME_DIR', xrd.trim());
Expand All @@ -513,7 +513,7 @@ class Application extends React.Component {
});
}
})
.fail(e => console.log("Could not read $XDG_RUNTIME_DIR: ", e.message));
.catch(e => console.log("Could not read $XDG_RUNTIME_DIR: ", e.message));
cockpit.spawn("selinuxenabled", { error: "ignore" })
.then(() => this.setState({ selinuxAvailable: true }))
.catch(() => this.setState({ selinuxAvailable: false }));
Expand Down

0 comments on commit 8153ef8

Please sign in to comment.