mirror of
https://github.com/ipnet-mesh/meshcore-hub.git
synced 2026-08-07 01:13:11 +02:00
Merge pull request #265 from ipnet-mesh/fix/packets-feature-flag-check
fix: normalize packets feature flag check to !== false
This commit is contained in:
@@ -96,7 +96,7 @@ if (features.messages !== false) {
|
||||
if (features.advertisements !== false) {
|
||||
router.addRoute('/advertisements', pageHandler(pages.advertisements));
|
||||
}
|
||||
if (features.packets === true) {
|
||||
if (features.packets !== false) {
|
||||
router.addRoute('/packets', pageHandler(pages.packets));
|
||||
router.addRoute('/packets/hash/:hash', pageHandler(pages.packetGroupDetail));
|
||||
router.addRoute('/packets/:id', pageHandler(pages.packetDetail));
|
||||
@@ -178,7 +178,7 @@ function updatePageTitle(pathname) {
|
||||
if (features.channels !== false) titles['/channels'] = composePageTitle('entities.channels');
|
||||
if (features.messages !== false) titles['/messages'] = composePageTitle('entities.messages');
|
||||
if (features.advertisements !== false) titles['/advertisements'] = composePageTitle('entities.advertisements');
|
||||
if (features.packets === true) titles['/packets'] = composePageTitle('entities.packets');
|
||||
if (features.packets !== false) titles['/packets'] = composePageTitle('entities.packets');
|
||||
if (features.map !== false) titles['/map'] = composePageTitle('entities.map');
|
||||
if (features.members !== false) titles['/members'] = composePageTitle('entities.members');
|
||||
titles['/profile'] = composePageTitle('links.profile');
|
||||
@@ -232,7 +232,7 @@ function renderMobileNav(config) {
|
||||
if (features.messages !== false) {
|
||||
items.push(html`<li><a href="/messages" data-nav-link>${iconMessages('h-5 w-5 nav-icon-messages')} ${t('entities.messages')}</a></li>`);
|
||||
}
|
||||
if (features.packets === true) {
|
||||
if (features.packets !== false) {
|
||||
items.push(html`<li><a href="/packets" data-nav-link>${iconPackets('h-5 w-5 nav-icon-packets')} ${t('entities.packets')}</a></li>`);
|
||||
}
|
||||
if (features.map !== false) {
|
||||
|
||||
@@ -39,7 +39,7 @@ export async function render(container, params, router) {
|
||||
|
||||
const config = getConfig();
|
||||
const features = config.features || {};
|
||||
const packetsEnabled = features.packets === true;
|
||||
const packetsEnabled = features.packets !== false;
|
||||
const tz = config.timezone || '';
|
||||
const tzBadge = tz && tz !== 'UTC' ? html`<span class="text-sm opacity-60">${tz}</span>` : nothing;
|
||||
const navigate = (url) => router.navigate(url);
|
||||
|
||||
@@ -105,7 +105,7 @@ function renderHeroSection({ networkName, logoUrl, logoInvertLight, networkCity,
|
||||
label: t('entities.messages'),
|
||||
colorVar: '--color-messages',
|
||||
}) : nothing}
|
||||
${features.packets === true ? renderNavCard({
|
||||
${features.packets !== false ? renderNavCard({
|
||||
href: '/packets',
|
||||
icon: iconPackets('w-full h-full'),
|
||||
label: t('entities.packets'),
|
||||
|
||||
@@ -26,7 +26,7 @@ export async function render(container, params, router) {
|
||||
|
||||
const config = getConfig();
|
||||
const features = config.features || {};
|
||||
const packetsEnabled = features.packets === true;
|
||||
const packetsEnabled = features.packets !== false;
|
||||
let channelLabels = new Map();
|
||||
const tz = config.timezone || '';
|
||||
const tzBadge = tz && tz !== 'UTC' ? html`<span class="text-sm opacity-60">${tz}</span>` : nothing;
|
||||
|
||||
Reference in New Issue
Block a user