diff --git a/src/renderer/app/components/ElectronSplashScreen/ElectronSplashScreen.tsx b/src/renderer/app/components/ElectronSplashScreen/ElectronSplashScreen.tsx index 5912fc4848..053432a36b 100644 --- a/src/renderer/app/components/ElectronSplashScreen/ElectronSplashScreen.tsx +++ b/src/renderer/app/components/ElectronSplashScreen/ElectronSplashScreen.tsx @@ -2,7 +2,7 @@ import logo from './assets/logo.svg'; export const ElectronSplashScreen = () => { return ( -
+
); diff --git a/src/renderer/app/components/WebSplashScreen/WebSplashScreen.tsx b/src/renderer/app/components/WebSplashScreen/WebSplashScreen.tsx index 1cd0ba3e05..c08b875eca 100644 --- a/src/renderer/app/components/WebSplashScreen/WebSplashScreen.tsx +++ b/src/renderer/app/components/WebSplashScreen/WebSplashScreen.tsx @@ -53,7 +53,7 @@ export const WebSplashScreen = () => { }, []); return ( -
+
diff --git a/src/renderer/app/index.css b/src/renderer/app/index.css index ebbf96beea..8cf0096728 100644 --- a/src/renderer/app/index.css +++ b/src/renderer/app/index.css @@ -6,8 +6,10 @@ html, body { width: 100%; + max-height: 100%; height: 100%; overflow: hidden; + transition: max-height 0.5s ease-in-out; } body { @@ -15,6 +17,13 @@ body { -moz-osx-font-smoothing: grayscale; } +@media (max-aspect-ratio: 32 / 25) and (width < 1024px) { + html, body { + max-height: 800px; + } +} + + /* Scrollbar for Firefox */ * { scrollbar-width: thin; diff --git a/src/renderer/app/index.html b/src/renderer/app/index.html index 3684b8bcd0..6078a5917e 100644 --- a/src/renderer/app/index.html +++ b/src/renderer/app/index.html @@ -11,7 +11,8 @@ - + + @@ -38,6 +39,6 @@ Nova Spektr -
+
diff --git a/src/renderer/entities/contact/model/contact-model.ts b/src/renderer/entities/contact/model/contact-model.ts index cc82c3d9fa..f04ab140b5 100644 --- a/src/renderer/entities/contact/model/contact-model.ts +++ b/src/renderer/entities/contact/model/contact-model.ts @@ -2,7 +2,7 @@ import { createEffect, createStore, sample } from 'effector'; import { storageService } from '@/shared/api/storage'; import { type Contact, kernelModel } from '@/shared/core'; -import { splice } from '@/shared/lib/utils'; +import { merge, splice } from '@/shared/lib/utils'; const $contacts = createStore([]); @@ -24,6 +24,14 @@ const updateContactFx = createEffect(async ({ id, ...rest }: Contact): Promise => { + if (contacts.length === 0) return []; + + await storageService.contacts.updateAll(contacts); + + return contacts; +}); + const deleteContactFx = createEffect(async (contactId: number): Promise => { await storageService.contacts.delete(contactId); @@ -44,6 +52,13 @@ $contacts const position = state.findIndex((s) => s.id === contact.id); return splice(state, contact, position); + }) + .on(updateContactsFx.doneData, (state, contacts) => { + return merge({ + a: state, + b: contacts, + mergeBy: (c) => c.id, + }); }); sample({ @@ -58,5 +73,6 @@ export const contactModel = { createContactsFx, deleteContactFx, updateContactFx, + updateContactsFx, }, }; diff --git a/src/renderer/entities/wallet/model/wallet-model.ts b/src/renderer/entities/wallet/model/wallet-model.ts index d7c0840763..50bdfd9190 100644 --- a/src/renderer/entities/wallet/model/wallet-model.ts +++ b/src/renderer/entities/wallet/model/wallet-model.ts @@ -90,18 +90,20 @@ type CreateResult = { accounts: Account[]; external: boolean; }; -const walletCreatedFx = createEffect(async ({ wallet, accounts }: CreateParams): Promise => { - const dbWallet = await storageService.wallets.create({ ...wallet, isActive: false }); +const walletCreatedFx = createEffect( + async ({ wallet, accounts, external }: CreateParams): Promise => { + const dbWallet = await storageService.wallets.create({ ...wallet, isActive: false }); - if (!dbWallet) return undefined; + if (!dbWallet) return undefined; - const accountsPayload = accounts.map((account) => ({ ...account, walletId: dbWallet.id })); - const dbAccounts = await storageService.accounts.createAll(accountsPayload); + const accountsPayload = accounts.map((account) => ({ ...account, walletId: dbWallet.id })); + const dbAccounts = await storageService.accounts.createAll(accountsPayload); - if (!dbAccounts) return undefined; + if (!dbAccounts) return undefined; - return { wallet: dbWallet, accounts: dbAccounts, external: false }; -}); + return { wallet: dbWallet, accounts: dbAccounts, external }; + }, +); const multishardCreatedFx = createEffect( async ({ diff --git a/src/renderer/features/app-shell/components/AppShell.tsx b/src/renderer/features/app-shell/components/AppShell.tsx index fceb9badd0..ffd3eb5997 100644 --- a/src/renderer/features/app-shell/components/AppShell.tsx +++ b/src/renderer/features/app-shell/components/AppShell.tsx @@ -11,7 +11,7 @@ export const AppShell = memo(() => { const headerNodes = useSlot(navigationHeaderSlot); return ( -
+