Разделить среды и закрепить лицензии в HEADER 1.0

This commit is contained in:
AidarKC
2026-12-05 11:42:20 +03:00
parent a64168a748
commit 77c7021aed
89 changed files with 4204 additions and 211 deletions
+9 -2
View File
@@ -1,3 +1,4 @@
import { setStorageEnvironment } from "./services/server-environment.js";
import { setDmPreviewSession } from './services/dm-preview-settings.js';
import { AuthService } from './services/auth-service.js';
import { getLanguage, setLanguage } from './i18n/index.js';
@@ -517,6 +518,13 @@ function createInitialState({ withStoredSession = true } = {}) {
export const state = createInitialState();
export const authService = new AuthService(state.entrySettings.shineServer);
state.serverEnvironment = null;
authService.onEnvironmentChange = (environment) => {
state.serverEnvironment = environment;
setStorageEnvironment(environment);
setSolanaCluster(environment?.solanaCluster ?? '');
window.dispatchEvent(new Event('shine:server-environment'));
};
authService.setRemoteAddBlockSessionId(state.entrySettings.remoteAddBlockSessionId);
authService.setActiveSessionContext({
login: state.session.login,
@@ -1105,8 +1113,7 @@ export async function saveEntrySettings(nextSettings) {
authService.setRemoteAddBlockSessionId(state.entrySettings.remoteAddBlockSessionId);
await authService.reconnect(state.entrySettings.shineServer);
try {
const info = await authService.ws.request('GetServerInfo', {}, 9000);
setSolanaCluster(info?.payload?.solanaCluster ?? info?.solanaCluster);
await authService.getServerEnvironment();
} catch (error) {
console.warn('Unable to refresh Solana network from the selected server', error);
}