Skip to content

Commit

Permalink
feat(client): added a check against Github to display the latest vers…
Browse files Browse the repository at this point in the history
…ion available when V is pressed
  • Loading branch information
will-moss committed May 10, 2024
1 parent 22ba875 commit 6ba526b
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions app/client/assets/js/isaiah.js
Original file line number Diff line number Diff line change
Expand Up @@ -3635,6 +3635,19 @@
state.message.isEnabled = true;
state.helper = 'message';
cmdRun(cmds._showPopup, 'message');

fetch(`https://api.github.com/repos/will-moss/isaiah/releases/latest`)
.then((r) => r.json())
.then((d) => {
const latestVersion = d.tag_name;

state.message.content +=
d.tag_name === VERSION
? `<br />It is the most recent version released.`
: `<br />The more recent version <em class="has-accent">${latestVersion}</em> is available.`;

cmdRun(cmds._render);
});
},
};

Expand Down

0 comments on commit 6ba526b

Please sign in to comment.