Default to dark theme if requested by user
This commit is contained in:
parent
3914a50b07
commit
5c48aa8c3e
2 changed files with 14 additions and 2 deletions
|
@ -67,7 +67,7 @@
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|
||||||
* :tada: Most robust uploads using a resumable upload endpoint [#3933](https://github.com/Chocobozzz/PeerTube/pull/3933)
|
* :tada: More robust uploads using a resumable upload endpoint [#3933](https://github.com/Chocobozzz/PeerTube/pull/3933)
|
||||||
* Accessibility/UI:
|
* Accessibility/UI:
|
||||||
* :tada: Redesign channel and account page
|
* :tada: Redesign channel and account page
|
||||||
* :tada: Increase video miniature size
|
* :tada: Increase video miniature size
|
||||||
|
|
|
@ -82,7 +82,19 @@ export class ThemeService {
|
||||||
: this.userService.getAnonymousUser().theme
|
: this.userService.getAnonymousUser().theme
|
||||||
|
|
||||||
if (theme !== 'instance-default') return theme
|
if (theme !== 'instance-default') return theme
|
||||||
return this.serverConfig.theme.default
|
|
||||||
|
const instanceTheme = this.serverConfig.theme.default
|
||||||
|
if (instanceTheme !== 'default') return instanceTheme
|
||||||
|
|
||||||
|
// Default to dark theme if available and wanted by the user
|
||||||
|
if (
|
||||||
|
this.themes.find(t => t.name === 'dark') &&
|
||||||
|
window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches
|
||||||
|
) {
|
||||||
|
return 'dark'
|
||||||
|
}
|
||||||
|
|
||||||
|
return instanceTheme
|
||||||
}
|
}
|
||||||
|
|
||||||
private loadTheme (name: string) {
|
private loadTheme (name: string) {
|
||||||
|
|
Loading…
Reference in a new issue