Новая обработка обновлений в соответствии с новым протоколом предоставляемым SDU серверами

This commit is contained in:
RoyceDa
2026-02-12 12:19:32 +02:00
parent ccec7d9446
commit b38918cb6d
7 changed files with 270 additions and 232 deletions

View File

@@ -29,6 +29,7 @@ import { useAccountProvider } from "@/app/providers/AccountProvider/useAccountPr
import { useLogout } from "@/app/providers/AccountProvider/useLogout";
import { useUpdateMessage } from "@/app/hooks/useUpdateMessage";
import { useDeviceMessage } from "@/app/hooks/useDeviceMessage";
import { UpdateProvider } from "@/app/providers/UpdateProvider/UpdateProvider";
export function Main() {
const { mainColor, borderColor } = useRosettaColors();
@@ -146,52 +147,54 @@ export function Main() {
<PrivateView>
<SystemAccountProvider>
<TransportProvider>
<Flex direction={'row'} style={{
height: '100%',
width: '100vw',
}}>
<div style={{
display: viewState != ViewPanelsState.DIALOGS_PANEL_HIDE ? 'block' : 'none',
width: viewState == ViewPanelsState.DIALOGS_PANEL_ONLY ? '100%' : '300px',
<UpdateProvider>
<Flex direction={'row'} style={{
height: '100%',
width: '100vw',
}}>
<DialogsPanel></DialogsPanel>
</div>
<Divider color={borderColor} orientation={'vertical'}></Divider>
{viewState != ViewPanelsState.DIALOGS_PANEL_ONLY && <Box
bg={mainColor}
style={{
flexGrow: 1,
height: 'calc(100vh - 27px)',
width: `calc(100% - 300px)`,
minWidth: 0
}}
>
<Routes>
<Route path={'/chat/:id'} element={<Chat />}></Route>
<Route path={'/profile/:id'} element={<Profile />}></Route>
<Route path={'/'} element={<DialogPreview />}></Route>
<Route path={'/theme'} element={<Theme />}></Route>
<Route path={'/safety'} element={<Safety />}></Route>
<Route path={'/update'} element={<Update />}></Route>
<Route path={'/backup'} element={<Backup />}></Route>
<Route path={'/dialogs'} element={<Dialogs />}></Route>
<Route path={'/newgroup'} element={<CreateGroup />}></Route>
<Route path={'/group/:id'} element={<GroupInfo />}></Route>
<Route path={'/groupencrypt/:key'} element={<GroupEncryption />}></Route>
</Routes>
</Box>}
</Flex>
{oldPublicKey && (
<Overlay blur={8} color="#333">
<Flex direction={'column'} align={'center'} justify={'center'} h={'100%'}>
<Alert w={400} variant="filled" color="red" title="Old account">
Your account uses an old format public key which is no longer supported. Please create a new account to continue using the application.
<br></br>After press "OK" button, the application will close and remove all data.
</Alert>
<Button w={400} mt={'md'} color="red" onClick={dropAccountsAndMessages}>OK</Button>
</Flex>
</Overlay>
)}
<div style={{
display: viewState != ViewPanelsState.DIALOGS_PANEL_HIDE ? 'block' : 'none',
width: viewState == ViewPanelsState.DIALOGS_PANEL_ONLY ? '100%' : '300px',
}}>
<DialogsPanel></DialogsPanel>
</div>
<Divider color={borderColor} orientation={'vertical'}></Divider>
{viewState != ViewPanelsState.DIALOGS_PANEL_ONLY && <Box
bg={mainColor}
style={{
flexGrow: 1,
height: 'calc(100vh - 27px)',
width: `calc(100% - 300px)`,
minWidth: 0
}}
>
<Routes>
<Route path={'/chat/:id'} element={<Chat />}></Route>
<Route path={'/profile/:id'} element={<Profile />}></Route>
<Route path={'/'} element={<DialogPreview />}></Route>
<Route path={'/theme'} element={<Theme />}></Route>
<Route path={'/safety'} element={<Safety />}></Route>
<Route path={'/update'} element={<Update />}></Route>
<Route path={'/backup'} element={<Backup />}></Route>
<Route path={'/dialogs'} element={<Dialogs />}></Route>
<Route path={'/newgroup'} element={<CreateGroup />}></Route>
<Route path={'/group/:id'} element={<GroupInfo />}></Route>
<Route path={'/groupencrypt/:key'} element={<GroupEncryption />}></Route>
</Routes>
</Box>}
</Flex>
{oldPublicKey && (
<Overlay blur={8} color="#333">
<Flex direction={'column'} align={'center'} justify={'center'} h={'100%'}>
<Alert w={400} variant="filled" color="red" title="Old account">
Your account uses an old format public key which is no longer supported. Please create a new account to continue using the application.
<br></br>After press "OK" button, the application will close and remove all data.
</Alert>
<Button w={400} mt={'md'} color="red" onClick={dropAccountsAndMessages}>OK</Button>
</Flex>
</Overlay>
)}
</UpdateProvider>
</TransportProvider>
</SystemAccountProvider>
</PrivateView>);