connect: hide "use real pw" when no accs (#242)

Disable the "use the real password" button on the connect page when there's no accounts
This commit is contained in:
ed 2025-07-28 19:33:16 +00:00 committed by GitHub
commit 025942a7d6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 3 deletions

View file

@ -36,7 +36,7 @@
<span class="os lin mac">
{% if accs %}<code><b id="pw0">{{ pw }}</b></code>=password, {% endif %}<code><b>mp</b></code>=mountpoint
</span>
<a href="#" id="setpw">use real password</a>
{% if accs %}<a href="#" id="setpw">use real password</a>{% endif %}
</p>

View file

@ -49,7 +49,7 @@ function setos(os) {
setos(WINDOWS ? 'win' : LINUX ? 'lin' : MACOS ? 'mac' : 'idk');
ebi('setpw').onclick = function (e) {
function setpw() {
ev(e);
modal.prompt('password:', '', function (v) {
if (!v)
@ -65,3 +65,5 @@ ebi('setpw').onclick = function (e) {
add_dls();
});
}
if (ebi('setpw'))
ebi('setpw').onclick = setpw;