Skip to content

Commit

Permalink
Force dark theme until light theme is implemented on viewer.
Browse files Browse the repository at this point in the history
  • Loading branch information
bitbound committed May 19, 2023
1 parent c4938d9 commit b418621
Showing 1 changed file with 20 additions and 18 deletions.
38 changes: 20 additions & 18 deletions Server/Services/RcImplementations/ViewerPageDataProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,26 +44,28 @@ public Task<string> GetPageTitle(PageModel pageModel)

public Task<ViewerPageTheme> GetTheme(PageModel pageModel)
{
if (pageModel.User.Identity.IsAuthenticated)
{
var user = _dataService.GetUserByNameWithOrg(pageModel.User.Identity.Name);
// TODO: Implement light theme in new viewer design.
return Task.FromResult(ViewerPageTheme.Dark);
//if (pageModel.User.Identity.IsAuthenticated)
//{
// var user = _dataService.GetUserByNameWithOrg(pageModel.User.Identity.Name);

var userTheme = user.UserOptions.Theme switch
{
Theme.Light => ViewerPageTheme.Light,
Theme.Dark => ViewerPageTheme.Dark,
_ => ViewerPageTheme.Dark
};
return Task.FromResult(userTheme);
}
// var userTheme = user.UserOptions.Theme switch
// {
// Theme.Light => ViewerPageTheme.Light,
// Theme.Dark => ViewerPageTheme.Dark,
// _ => ViewerPageTheme.Dark
// };
// return Task.FromResult(userTheme);
//}

var appTheme = _appConfig.Theme switch
{
Theme.Light => ViewerPageTheme.Light,
Theme.Dark => ViewerPageTheme.Dark,
_ => ViewerPageTheme.Dark
};
return Task.FromResult(appTheme);
//var appTheme = _appConfig.Theme switch
//{
// Theme.Light => ViewerPageTheme.Light,
// Theme.Dark => ViewerPageTheme.Dark,
// _ => ViewerPageTheme.Dark
//};
//return Task.FromResult(appTheme);
}

public Task<string> GetUserDisplayName(PageModel pageModel)
Expand Down

0 comments on commit b418621

Please sign in to comment.