mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
correct issue where no selected theme would force incorrect selection
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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()
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user