Skip to content

Commit a8227d9

Browse files
committed
feat(theme): should have auto behaviour when theme option is empty
1 parent 6a8d984 commit a8227d9

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/components/docker-registry-ui.riot

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
101101
<li>
102102
<a href="https://github.com/Joxit/docker-registry-ui/blob/main/LICENSE">License AGPL-3.0</a>
103103
</li>
104-
<li if="{ props.theme === 'auto' }">
104+
<li if="{ props.theme === 'auto' || props.theme === '' }">
105105
<material-switch
106106
on-change="{ onThemeChange }"
107107
checked="{ state.themeSwitch }"

src/scripts/theme.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const normalizeKey = (k) =>
3434
.replace(/^theme-/, '');
3535

3636
const preferDarkMode = ({ theme }) => {
37-
if (theme === 'auto') {
37+
if (theme === 'auto' || theme === "") {
3838
switch (localStorage.getItem(LOCAL_STORAGE_THEME)) {
3939
case 'dark':
4040
return true;

0 commit comments

Comments
 (0)