FIX: Allow reverting theme/text settings from cookie back to default

This commit is contained in:
David Taylor
2019-02-08 15:39:44 +00:00
parent 62043e6904
commit 95eb4c67f2
5 changed files with 43 additions and 22 deletions

View File

@ -719,11 +719,15 @@ const User = RestModel.extend({
},
updateTextSizeCookie(newSize) {
const seq = this.get("user_option.text_size_seq");
$.cookie("text_size", `${newSize}|${seq}`, {
path: "/",
expires: 9999
});
if (newSize) {
const seq = this.get("user_option.text_size_seq");
$.cookie("text_size", `${newSize}|${seq}`, {
path: "/",
expires: 9999
});
} else {
$.removeCookie("text_size", { path: "/", expires: 1 });
}
}
});