Оптимизация читаемости кода, лучшая организация архитектуры
This commit is contained in:
@@ -4,7 +4,7 @@ import { useUploadStatus } from "../TransportProvider/useUploadStatus";
|
||||
import { useFileStorage } from "../../hooks/useFileStorage";
|
||||
import { usePublicKey } from "../AccountProvider/usePublicKey";
|
||||
import { usePrivatePlain } from "../AccountProvider/usePrivatePlain";
|
||||
import { decodeWithPassword, encodeWithPassword, generateMd5 } from "../../crypto/crypto";
|
||||
import { decodeWithPassword, encodeWithPassword, generateMd5 } from "../../workers/crypto/crypto";
|
||||
import { useTransport } from "../TransportProvider/useTransport";
|
||||
import { useDialogsCache } from "../DialogProvider/useDialogsCache";
|
||||
import { useConsoleLogger } from "../../hooks/useConsoleLogger";
|
||||
|
||||
@@ -2,7 +2,7 @@ import { useDatabase } from "@/app/providers/DatabaseProvider/useDatabase";
|
||||
import { createContext, useEffect, useRef, useState } from "react";
|
||||
import { usePublicKey } from "../AccountProvider/usePublicKey";
|
||||
import { useFileStorage } from "@/app/hooks/useFileStorage";
|
||||
import { decodeWithPassword, encodeWithPassword, generateMd5 } from "@/app/crypto/crypto";
|
||||
import { decodeWithPassword, encodeWithPassword, generateMd5 } from "@/app/workers/crypto/crypto";
|
||||
import { useConsoleLogger } from "@/app/hooks/useConsoleLogger";
|
||||
import { useSystemAccounts } from "../SystemAccountsProvider/useSystemAccounts";
|
||||
import { AVATAR_PASSWORD_TO_ENCODE } from "@/app/constants";
|
||||
|
||||
@@ -2,7 +2,7 @@ import { useEffect, useState } from "react";
|
||||
import { DialogRow } from "./DialogListProvider";
|
||||
import { useDatabase } from "@/app/providers/DatabaseProvider/useDatabase";
|
||||
import { usePublicKey } from "../AccountProvider/usePublicKey";
|
||||
import { decodeWithPassword } from "@/app/crypto/crypto";
|
||||
import { decodeWithPassword } from "@/app/workers/crypto/crypto";
|
||||
import { constructLastMessageTextByAttachments } from "@/app/utils/constructLastMessageTextByAttachments";
|
||||
import { usePrivatePlain } from "../AccountProvider/usePrivatePlain";
|
||||
import { DeliveredMessageState, Message } from "../DialogProvider/DialogProvider";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { chacha20Decrypt, decodeWithPassword, decrypt, encodeWithPassword, generateMd5 } from '@/app/crypto/crypto';
|
||||
import { chacha20Decrypt, decodeWithPassword, decrypt, encodeWithPassword, generateMd5 } from '@/app/workers/crypto/crypto';
|
||||
import { useDatabase } from '@/app/providers/DatabaseProvider/useDatabase';
|
||||
import { createContext, useEffect, useRef, useState } from 'react';
|
||||
import { Attachment, AttachmentType, PacketMessage } from '@/app/providers/ProtocolProvider/protocol/packets/packet.message';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useContext } from "react";
|
||||
import { useDatabase } from "../DatabaseProvider/useDatabase";
|
||||
import { chacha20Encrypt, encodeWithPassword, encrypt, generateMd5} from "../../crypto/crypto";
|
||||
import { chacha20Encrypt, encodeWithPassword, encrypt, generateMd5} from "../../workers/crypto/crypto";
|
||||
import { AttachmentMeta, DeliveredMessageState, DialogContext, Message } from "./DialogProvider";
|
||||
import { Attachment, AttachmentType, PacketMessage } from "@/app/providers/ProtocolProvider/protocol/packets/packet.message";
|
||||
import { usePublicKey } from "../AccountProvider/usePublicKey";
|
||||
|
||||
@@ -12,7 +12,7 @@ import { useDialogsCache } from "./useDialogsCache";
|
||||
import { useDatabase } from "@/app/providers/DatabaseProvider/useDatabase";
|
||||
import { usePrivatePlain } from "../AccountProvider/usePrivatePlain";
|
||||
import { usePublicKey } from "../AccountProvider/usePublicKey";
|
||||
import { chacha20Decrypt, decodeWithPassword, decrypt, encodeWithPassword, generateMd5 } from "@/app/crypto/crypto";
|
||||
import { chacha20Decrypt, decodeWithPassword, decrypt, encodeWithPassword, generateMd5 } from "@/app/workers/crypto/crypto";
|
||||
import { DeliveredMessageState, Message } from "./DialogProvider";
|
||||
import { PacketRead } from "../ProtocolProvider/protocol/packets/packet.read";
|
||||
import { PacketDelivery } from "../ProtocolProvider/protocol/packets/packet.delivery";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useDatabase } from "@/app/providers/DatabaseProvider/useDatabase";
|
||||
import { usePrivatePlain } from "../AccountProvider/usePrivatePlain";
|
||||
import { decodeWithPassword, encodeWithPassword } from "@/app/crypto/crypto";
|
||||
import { decodeWithPassword, encodeWithPassword } from "@/app/workers/crypto/crypto";
|
||||
import { generateRandomKey } from "@/app/utils/utils";
|
||||
import { useDialogsList } from "../DialogListProvider/useDialogsList";
|
||||
import { usePublicKey } from "../AccountProvider/usePublicKey";
|
||||
|
||||
@@ -3,7 +3,7 @@ import { createContext } from "react";
|
||||
import { useSystemAccount } from "./useSystemAccount";
|
||||
import { usePublicKey } from "../AccountProvider/usePublicKey";
|
||||
import { usePrivatePlain } from "../AccountProvider/usePrivatePlain";
|
||||
import { chacha20Encrypt, encodeWithPassword, encrypt } from "@/app/crypto/crypto";
|
||||
import { chacha20Encrypt, encodeWithPassword, encrypt } from "@/app/workers/crypto/crypto";
|
||||
import { generateRandomKey } from "@/app/utils/utils";
|
||||
import { DeliveredMessageState } from "../DialogProvider/DialogProvider";
|
||||
import { UserInformation } from "../InformationProvider/InformationProvider";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { decodeWithPassword, encodeWithPassword } from "@/app/crypto/crypto";
|
||||
import { decodeWithPassword, encodeWithPassword } from "@/app/workers/crypto/crypto";
|
||||
import { useFileStorage } from "@/app/hooks/useFileStorage";
|
||||
import { generateRandomKey } from "@/app/utils/utils";
|
||||
import { createContext, useEffect, useState } from "react";
|
||||
|
||||
@@ -3,7 +3,7 @@ import { InternalScreen } from "@/app/components/InternalScreen/InternalScreen";
|
||||
import { SettingsAlert } from "@/app/components/SettingsAlert/SettingsAlert";
|
||||
import { SettingsInput } from "@/app/components/SettingsInput/SettingsInput";
|
||||
import { TextChain } from "@/app/components/TextChain/TextChain";
|
||||
import { decodeWithPassword } from "@/app/crypto/crypto";
|
||||
import { decodeWithPassword } from "@/app/workers/crypto/crypto";
|
||||
import { useAccount } from "@/app/providers/AccountProvider/useAccount";
|
||||
import { Text } from "@mantine/core";
|
||||
import { useState } from "react";
|
||||
|
||||
@@ -3,7 +3,7 @@ import classes from './Lockscreen.module.css'
|
||||
import { useEffect, useState } from "react";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import useWindow from "@/app/hooks/useWindow";
|
||||
import { decodeWithPassword, generateHashFromPrivateKey } from "@/app/crypto/crypto";
|
||||
import { decodeWithPassword, generateHashFromPrivateKey } from "@/app/workers/crypto/crypto";
|
||||
import { useAccountProvider } from "@/app/providers/AccountProvider/useAccountProvider";
|
||||
import { Account, AccountBase } from "@/app/providers/AccountProvider/AccountProvider";
|
||||
import { useUserCache } from "@/app/providers/InformationProvider/useUserCache";
|
||||
|
||||
@@ -7,7 +7,7 @@ import { mnemonicToSeed } from "web-bip39";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import { modals } from "@mantine/modals";
|
||||
import { Buffer } from 'buffer'
|
||||
import { encodeWithPassword, generateHashFromPrivateKey, generateKeyPairFromSeed } from "@/app/crypto/crypto";
|
||||
import { encodeWithPassword, generateHashFromPrivateKey, generateKeyPairFromSeed } from "@/app/workers/crypto/crypto";
|
||||
import { useAccountProvider } from "@/app/providers/AccountProvider/useAccountProvider";
|
||||
import { Account } from "@/app/providers/AccountProvider/AccountProvider";
|
||||
import { useRosettaColors } from "@/app/hooks/useRosettaColors";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { sha256, md5 } from "node-forge";
|
||||
import { generateRandomKey } from "../utils/utils";
|
||||
import { generateRandomKey } from "../../utils/utils";
|
||||
import * as secp256k1 from '@noble/secp256k1';
|
||||
|
||||
const worker = new Worker(new URL('./crypto.worker.ts', import.meta.url), { type: 'module' });
|
||||
Reference in New Issue
Block a user