Skip to content

Commit

Permalink
Merge pull request #24 from stv0g/fix-22
Browse files Browse the repository at this point in the history
Only request shortened link if link shortener is configured
  • Loading branch information
stv0g authored Jun 9, 2022
2 parents 7034657 + e7f6ef0 commit e1ddcd4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion frontend/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ <h2 class="accordion-header" id="heading-settings">
</div>
</div>
<div class="mb-3 form-check form-switch d-none" id="config-shorten">
<input class="form-check-input" type="checkbox" value="" id="shorten-link" checked>
<input class="form-check-input" type="checkbox" value="" id="shorten-link">
<label for="shorten-link" class="form-check-label">Shorten Link</label>
</div>
<div class="d-none" id="config-encrypt">
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ function getUploadParams(): UploadParams {
}

function onConfig(config: Config) {
let cbShortURL = document.getElementById("shorten-link") as HTMLInputElement;
let selServers = document.getElementById("servers") as HTMLSelectElement;
let divServers = document.getElementById("config-servers");

Expand Down Expand Up @@ -315,6 +316,8 @@ function onConfig(config: Config) {
if (config.features.short_url) {
let divShorten = document.getElementById("config-shorten");
divShorten.classList.remove("d-none");

cbShortURL.click();
}

if (config.features.notify_mail) {
Expand Down

0 comments on commit e1ddcd4

Please sign in to comment.