Skip to content

Commit

Permalink
Merge pull request #133 from watermelontools/fix/slack-button-running…
Browse files Browse the repository at this point in the history
…-search

Fixed button
  • Loading branch information
EstebanDalelR authored Apr 22, 2022
2 parents 46353a1 + e0d07db commit 3afd5e7
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions media/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ while (!$) {
}
const vscode = acquireVsCodeApi();

const button = document.querySelector("button");
const link = document.getElementsByClassName("help-link");
const button = document.querySelector("button");

let errorTimeout;
function sendMessage(message) {
Expand All @@ -19,14 +19,13 @@ Sentry.init({
// We recommend adjusting this value in production
tracesSampleRate: 1.0,
});

link[0].addEventListener("click", (event) => {
sendMessage({ command: "open-link", link: "https://app.slack.com" });
});
button.addEventListener("click", (event) => {
sendMessage({ command: "run" });
});

link[0].addEventListener("click", (event) => {
sendMessage({ command: "open-link", link: "https://app.slack.com" });
});
$(document).ready(function () {
const replaceIssueLinks = (text, repo_url) => {
let repoLink = repo_url.replace("api.", "").replace("repos/", "");
Expand Down Expand Up @@ -131,9 +130,12 @@ $(document).ready(function () {
</div>
`);
$("#ghHolder").append("<button>Run Watermelon</button><br/>");
$("#ghHolder").append(
"<button class='help-link' >Get help on Slack</button>"
);
$("#ghHolder")
.append("<button class='help-link' >Get help on Slack</button>")
.on("click", (event) => {
sendMessage({ command: "open-link", link: "https://app.slack.com" });
});

$("#ghHolder").append(
"<p>Alternatively, you can <a href='https://github.com/watermelontools/wm-extension#commands'>run with our watermelon.start command</a></p>"
);
Expand Down

0 comments on commit 3afd5e7

Please sign in to comment.