Switch client to default theme when it is using a theme that has been removed
This commit is contained in:
parent
4e5c924e5c
commit
62fb5524ae
@ -281,7 +281,7 @@ function initialize() {
|
||||
}
|
||||
|
||||
$settings.on("change", "input, select, textarea", function(e) {
|
||||
// We only want to trigger on human triggerd changes.
|
||||
// We only want to trigger on human triggered changes.
|
||||
if (e.originalEvent) {
|
||||
const $self = $(this);
|
||||
const type = $self.prop("type");
|
||||
|
@ -25,6 +25,12 @@ socket.on("configuration", function(data) {
|
||||
options.initialize();
|
||||
webpush.initialize();
|
||||
|
||||
// If localStorage contains a theme that does not exist on this server, switch
|
||||
// back to its default theme.
|
||||
if (!data.themes.map((t) => t.name).includes(options.settings.theme)) {
|
||||
options.processSetting("theme", data.defaultTheme, true);
|
||||
}
|
||||
|
||||
const forms = $("#connect form, #change-password form");
|
||||
|
||||
forms.on("submit", function() {
|
||||
|
@ -555,6 +555,7 @@ function getClientConfiguration() {
|
||||
config.version = pkg.version;
|
||||
config.gitCommit = Helper.getGitCommit();
|
||||
config.themes = themes.getAll();
|
||||
config.defaultTheme = Helper.config.theme;
|
||||
|
||||
if (config.displayNetwork) {
|
||||
config.defaults = _.clone(Helper.config.defaults);
|
||||
|
Loading…
Reference in New Issue
Block a user