Skip to content

Commit

Permalink
Fixed pasta creation bug
Browse files Browse the repository at this point in the history
Fixed a bug that caused new uploads not to save their text content if the server had the encryption features turned off
  • Loading branch information
szabodanika committed Jul 8, 2023
1 parent efdcf0f commit 664c449
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -146,15 +146,25 @@
<select style="width: 100%;" name="privacy" id="privacy">
<optgroup label="Unencrypted (no password)">
<option value="public">Public</option>
{% if args.private %}
<option value="unlisted">Unlisted</option>
{%- endif %}
</optgroup>
{% if args.enable_readonly %}
<optgroup label="Unencrypted (protected)">
<option value="readonly">Read-only</option>
</optgroup>
{%- endif %}
{% if args.encryption_client_side || args.encryption_server_side %}
<optgroup label="Encrypted">
{% if args.encryption_server_side %}
<option value="private">Private</option>
{%- endif %}
{% if args.encryption_client_side%}
<option value="secret">Secret</option>
{%- endif %}
</optgroup>
{%- endif %}
</select>
</div>

Expand Down Expand Up @@ -218,7 +228,6 @@
form.onsubmit = async function (event) {
event.preventDefault(); // prevent default form submission

// this if is not correct i fink
// {% if args.encryption_client_side || args.encryption_server_side %}
if (passwordField.value.trim() != "") {
if (fileOversized()) return false;
Expand Down Expand Up @@ -249,14 +258,17 @@
hiddenEncryptedClientSide.name = "";
content.value = contentInput.value;
}
// ????
// {%- else %}
hiddenEncryptedClientSide.name = "";
content.value = contentInput.value;
// {%- endif %}

if (contentInput.value.trim() == "" && hiddenFileButton.files.length == 0) {
contentInput.focus();
return false;
}


form.submit();
};

Expand Down

0 comments on commit 664c449

Please sign in to comment.