correct issue where no selected theme would force incorrect selection

This commit is contained in:
Sam 2017-04-12 13:00:25 -04:00
parent bbecc65737
commit d0fa8cda76
2 changed files with 3 additions and 2 deletions

View File

@ -2,7 +2,7 @@ import { ajax } from 'discourse/lib/ajax';
import { refreshCSS } from 'discourse/initializers/live-development';
const keySelector = 'meta[name=discourse_theme_key]';
function currentThemeKey() {
export function currentThemeKey() {
let themeKey = null;
let elem = _.first($(keySelector));
if (elem) {

View File

@ -1,6 +1,7 @@
import RestrictedUserRoute from "discourse/routes/restricted-user";
import showModal from 'discourse/lib/show-modal';
import { popupAjaxError } from 'discourse/lib/ajax-error';
import { currentThemeKey } from 'discourse/lib/theme-selector';
export default RestrictedUserRoute.extend({
model() {
@ -12,7 +13,7 @@ export default RestrictedUserRoute.extend({
controller.setProperties({
model: user,
newNameInput: user.get('name'),
selectedTheme: $.cookie('preview_style')
selectedTheme: $.cookie('preview_style') || currentThemeKey()
});
},