Merge remote-tracking branch 'origin/master' into develop

isekai-main
Julian Lam 2 years ago
commit a2fafc2b15

@ -5,10 +5,12 @@ on:
branches: branches:
- master - master
- develop - develop
- bootstrap5
pull_request: pull_request:
branches: branches:
- master - master
- develop - develop
- bootstrap5
defaults: defaults:
run: run:

@ -87,13 +87,13 @@ define('search', ['translator', 'storage', 'hooks', 'alerts'], function (transla
const filterCategoryEl = quickSearchResults.find('.filter-category'); const filterCategoryEl = quickSearchResults.find('.filter-category');
function updateCategoryFilterName() { function updateCategoryFilterName() {
if (ajaxify.data.template.category) { if (ajaxify.data.template.category && ajaxify.data.cid) {
translator.translate('[[search:search-in-category, ' + ajaxify.data.name + ']]', function (translated) { translator.translate('[[search:search-in-category, ' + ajaxify.data.name + ']]', function (translated) {
const name = $('<div></div>').html(translated).text(); const name = $('<div></div>').html(translated).text();
filterCategoryEl.find('.name').text(name); filterCategoryEl.find('.name').text(name);
}); });
} }
filterCategoryEl.toggleClass('hidden', !ajaxify.data.template.category); filterCategoryEl.toggleClass('hidden', !(ajaxify.data.template.category && ajaxify.data.cid));
} }
function doSearch() { function doSearch() {
@ -101,7 +101,7 @@ define('search', ['translator', 'storage', 'hooks', 'alerts'], function (transla
options.searchOptions.term = inputEl.val(); options.searchOptions.term = inputEl.val();
updateCategoryFilterName(); updateCategoryFilterName();
if (ajaxify.data.template.category) { if (ajaxify.data.template.category && ajaxify.data.cid) {
if (filterCategoryEl.find('input[type="checkbox"]').is(':checked')) { if (filterCategoryEl.find('input[type="checkbox"]').is(':checked')) {
options.searchOptions.categories = [ajaxify.data.cid]; options.searchOptions.categories = [ajaxify.data.cid];
options.searchOptions.searchChildren = true; options.searchOptions.searchChildren = true;

@ -86,15 +86,16 @@ module.exports = function (middleware) {
} }
return next(); return next();
} }
if (parseInt(req.uid, 10) > 0 || !meta.config.autoDetectLang) {
return next(); if (meta.config.autoDetectLang && req.uid === 0) {
} const langs = await listCodes();
const langs = await listCodes(); const lang = req.acceptsLanguages(langs);
const lang = req.acceptsLanguages(langs); if (!lang) {
if (!lang) { return next();
return next(); }
req.query.lang = lang;
} }
req.query.lang = lang;
next(); next();
}); });

@ -141,6 +141,7 @@
.notification-body img { .notification-body img {
max-width: 100%; max-width: 100%;
height: auto;
} }
</style> </style>

Loading…
Cancel
Save