Skip to content

Commit

Permalink
hide password resets on setup when emby selected
Browse files Browse the repository at this point in the history
  • Loading branch information
hrfee committed Mar 18, 2021
1 parent 111533f commit c556878
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 16 deletions.
Binary file added %home%hrfee%projects%go%jfa-go%config.go.swp
Binary file not shown.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -48,7 +48,7 @@ docker create \
-p 8056:8056 \
# -p 8057:8057 if using tls
-v /path/to/.config/jfa-go:/data \ # Path to wherever you want to store the config file and other data
-v /path/to/jellyfin:/jf \ # Path to jellyfin config directory
-v /path/to/jellyfin:/jf \ # Path to Jellyfin config directory, ignore if using Emby
-v /etc/localtime:/etc/localtime:ro \ # Makes sure time is correct
hrfee/jfa-go # hrfee/jfa-go:unstable for latest build from git
```
Expand Down
2 changes: 1 addition & 1 deletion html/setup.html
Expand Up @@ -351,7 +351,7 @@
</div>
</section>
</div>
<div class="card ~neutral !low mb-1 unfocused related-to-email">
<div id="password-resets" class="card ~neutral !low mb-1 unfocused related-to-email">
<span class="heading">{{ .lang.PasswordResets.title }}</span>
<p class="content">{{ .lang.PasswordResets.description }}</p>
<label class="row switch pb-1">
Expand Down
37 changes: 23 additions & 14 deletions ts/setup.ts
Expand Up @@ -287,20 +287,17 @@ const settings = {
}
};

(() => {
const checkTheme = () => {
if (settings["ui"]["theme"].value.includes("Dark")) {
document.documentElement.classList.add("dark-theme");
document.documentElement.classList.remove("light-theme");
} else {
document.documentElement.classList.add("light-theme");
document.documentElement.classList.remove("dark-theme");
}
};
settings["ui"]["theme"].onchange = checkTheme;
checkTheme();
})();

const checkTheme = () => {
if (settings["ui"]["theme"].value.includes("Dark")) {
document.documentElement.classList.add("dark-theme");
document.documentElement.classList.remove("light-theme");
} else {
document.documentElement.classList.add("light-theme");
document.documentElement.classList.remove("dark-theme");
}
};
settings["ui"]["theme"].onchange = checkTheme;
checkTheme();

const restartButton = document.getElementById("restart") as HTMLSpanElement;
const serialize = () => {
Expand Down Expand Up @@ -359,6 +356,18 @@ const emailMethodChange = () => {
settings["email"]["method"].onchange = emailMethodChange;
emailMethodChange();

const embyHidePWR = () => {
const pwr = document.getElementById("password-resets");
const val = settings["jellyfin"]["type"].value;
if (val == "jellyfin") {
pwr.classList.remove("hidden");
} else if (val == "emby") {
pwr.classList.add("hidden");
}
}
settings["jellyfin"]["type"].onchange = embyHidePWR;
embyHidePWR();

(window as any).settings = settings;

for (let section in settings) {
Expand Down

0 comments on commit c556878

Please sign in to comment.