SHA256
GPT: сгенерено и не проверено (смена ключей пользователя)
This commit is contained in:
@@ -16,6 +16,7 @@ import { initPwaInstallPromptHandling } from './services/pwa-install-service.js'
|
||||
import { initPwaPush } from './services/pwa-push-service.js';
|
||||
import { initCallUiOverlay } from './services/call-ui-service.js';
|
||||
import { showToast } from './services/channels-ux.js';
|
||||
import { KeyRotationClient } from './services/key-rotation-service.js';
|
||||
import {
|
||||
handleCallPushAction,
|
||||
handleIncomingCallInvite,
|
||||
@@ -73,6 +74,8 @@ import * as profileEditView from './pages/profile-edit-view.js';
|
||||
import * as profilesView from './pages/profiles-view.js';
|
||||
import * as walletView from './pages/wallet-view.js?v=202609260900';
|
||||
import * as settingsView from './pages/settings-view.js';
|
||||
import * as myBlockchainView from './pages/my-blockchain-view.js';
|
||||
import * as keyRotationView from './pages/key-rotation-view.js';
|
||||
import * as accessServersView from './pages/access-servers-view.js';
|
||||
import * as developerSettingsView from './pages/developer-settings-view.js';
|
||||
import * as advancedSettingsView from './pages/advanced-settings-view.js';
|
||||
@@ -142,6 +145,8 @@ const routes = {
|
||||
'profiles-view': profilesView,
|
||||
'wallet-view': walletView,
|
||||
'settings-view': settingsView,
|
||||
'my-blockchain-view': myBlockchainView,
|
||||
'key-rotation-view': keyRotationView,
|
||||
'access-servers-view': accessServersView,
|
||||
'developer-settings-view': developerSettingsView,
|
||||
'advanced-settings-view': advancedSettingsView,
|
||||
@@ -1376,6 +1381,21 @@ function attachPageScrollToBottom(pageId, screen) {
|
||||
});
|
||||
}
|
||||
|
||||
async function redirectToActiveKeyRotationIfNeeded() {
|
||||
if (!state.session.isAuthorized || state.session.isLocalDemo) return false;
|
||||
try {
|
||||
const rotation = await new KeyRotationClient(authService).status();
|
||||
const status = String(rotation?.rotationStatus || 'NONE');
|
||||
if (status !== 'NONE' && getRoute().pageId !== 'key-rotation-view') {
|
||||
navigate('key-rotation-view');
|
||||
return true;
|
||||
}
|
||||
} catch (error) {
|
||||
console.warn('[key-rotation] status check failed', error);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function renderApp() {
|
||||
syncTrackedRouteHistory(window.location.pathname || '/');
|
||||
const route = getRoute();
|
||||
@@ -1566,6 +1586,7 @@ async function init() {
|
||||
setSessionAuthorizedHandler(() => {
|
||||
void ensureSessionRuntimeStarted();
|
||||
void processPendingCallPushActionIfPossible();
|
||||
void redirectToActiveKeyRotationIfNeeded();
|
||||
});
|
||||
|
||||
if ('serviceWorker' in navigator) {
|
||||
|
||||
Reference in New Issue
Block a user