Skip to content

Commit

Permalink
change commit-button script
Browse files Browse the repository at this point in the history
  • Loading branch information
albertfolch-redeemeum committed Apr 2, 2024
1 parent 01abf3f commit 3b0e44c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion public/scripts/commit-button-example.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<head>
<script src="./zoid/zoid.js"></script>
<script src="https://widgets-test.on.fleek.co/scripts/commit-button.js"></script>
<script src="../../scripts/commit-button.js"></script>
<style>
html,
body {
Expand Down
3 changes: 3 additions & 0 deletions public/scripts/commit-button.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ function getScriptOrigin() {
'script[src$="/commit-button.js"]'
);
const src = scriptElCommitButton.getAttribute("src");
if (src.startsWith("../../")) {
return `${window.location.origin}/#`;
}
const url = new URL(src);
return `${url.origin}/#`;
}
Expand Down

0 comments on commit 3b0e44c

Please sign in to comment.