Скрыть тестовые версии связей по умолчанию

This commit is contained in:
AidarKC
2026-11-30 11:09:55 +03:00
parent e11c39e933
commit 10d9d0a45a
10 changed files with 121 additions and 28 deletions
@@ -3,6 +3,7 @@ import * as modernNetworkView from './network-view.js';
import * as legacyNetworkView from './network-legacy/network-view.js';
import * as explorerNetworkView from './network-explorer/network-view.js';
import * as explorerCanvasView from './network-canvas-v4/network-view.js';
import { isDeveloperToolsEnabled } from '../services/feature-settings.js';
const NETWORK_VERSION_STORAGE_KEY = 'shine.network.version';
const MODES = new Set(['legacy', 'modern', 'explorer', 'explorer-canvas']);
@@ -14,6 +15,7 @@ window.addEventListener('shine:network-tab-enter', explorerNetworkView.resetExpl
export const pageMeta = modernNetworkView.pageMeta;
function selectedMode() {
if (!isDeveloperToolsEnabled()) return DEFAULT_MODE;
try {
const saved = window.localStorage.getItem(NETWORK_VERSION_STORAGE_KEY);
return MODES.has(saved) ? saved : DEFAULT_MODE;
@@ -64,7 +66,7 @@ export function render(context = {}) {
if (!topbarLeft || topbarLeft.querySelector('.network-version-switcher')) return;
topbarLeft.append(createModeSwitcher(mode, context.navigate));
};
attachSwitcher();
if (isDeveloperToolsEnabled()) attachSwitcher();
const topbarSlot = document.getElementById('topbar-slot');
const observer = typeof MutationObserver === 'function' && topbarSlot