mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 19:01:52 +08:00
correct issue where no selected theme would force incorrect selection
This commit is contained in:
parent
bbecc65737
commit
d0fa8cda76
|
@ -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()
|
||||
});
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user