@coopenomics/desktop 2.2.2 → 2.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,14 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [2.2.3](https://github.com/coopenomics/monocoop/compare/v2.2.0...v2.2.3) (2025-01-16)
7
+
8
+ **Note:** Version bump only for package @coopenomics/desktop
9
+
10
+
11
+
12
+
13
+
6
14
  ## [2.2.1](https://github.com/coopenomics/monocoop/compare/v2.2.0...v2.2.1) (2025-01-14)
7
15
 
8
16
  **Note:** Version bump only for package @coopenomics/desktop
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coopenomics/desktop",
3
- "version": "2.2.2",
3
+ "version": "2.2.3",
4
4
  "description": "A Desktop Project",
5
5
  "productName": "Desktop App",
6
6
  "author": "Alex Ant <dacom.dark.sun@gmail.com>",
@@ -20,8 +20,8 @@
20
20
  "prepublishOnly": "npm run build:lib"
21
21
  },
22
22
  "dependencies": {
23
- "@coopenomics/controller": "2.2.2",
24
- "@coopenomics/sdk": "2.2.2",
23
+ "@coopenomics/controller": "2.2.3",
24
+ "@coopenomics/sdk": "2.2.3",
25
25
  "@dicebear/collection": "^9.0.1",
26
26
  "@dicebear/core": "^9.0.1",
27
27
  "@fortawesome/fontawesome-svg-core": "^6.5.2",
@@ -45,7 +45,7 @@
45
45
  "@wharfkit/wallet-plugin-privatekey": "^1.1.0",
46
46
  "axios": "^1.2.1",
47
47
  "compression": "^1.7.4",
48
- "cooptypes": "^2.2.2",
48
+ "cooptypes": "^2.2.3",
49
49
  "dompurify": "^3.1.7",
50
50
  "dotenv": "^16.4.5",
51
51
  "email-regex": "^5.0.0",
@@ -94,5 +94,5 @@
94
94
  "npm": ">= 6.13.4",
95
95
  "yarn": ">= 1.21.1"
96
96
  },
97
- "gitHead": "88352202b02fd190abd2c892290cb668ba137cb8"
97
+ "gitHead": "40fb5c80eb4136e82813fd553703f4a7926166a0"
98
98
  }
@@ -5,6 +5,7 @@ import {client} from 'src/shared/api/client'
5
5
  import { useCurrentUserStore } from 'src/entities/User'
6
6
  import { useSystemStore } from 'src/entities/System/model'
7
7
  import { useRegistratorStore } from 'src/entities/Registrator'
8
+ import type { ITokens } from 'src/shared/lib/types/user'
8
9
 
9
10
  export function useLoginUser() {
10
11
  const globalStore = useGlobalStore()
@@ -12,10 +13,23 @@ export function useLoginUser() {
12
13
  const system = useSystemStore()
13
14
 
14
15
  async function login(email: string, wif: string): Promise<void> {
15
- const auth = await api.loginUser(email, wif)
16
+ const auth = await api.loginUser(email, wif);
17
+ const { tokens, account } = await client.login(email, wif);
16
18
 
17
- await globalStore.setWif(auth.user.username, wif)
18
- await globalStore.setTokens(auth.tokens)
19
+ // Создаём объект tokens с правильными типами
20
+ const adaptedTokens: ITokens = {
21
+ access: {
22
+ token: tokens.access.token,
23
+ expires: new Date(tokens.access.expires as string),
24
+ },
25
+ refresh: {
26
+ token: tokens.refresh.token,
27
+ expires: new Date(tokens.refresh.expires as string),
28
+ },
29
+ };
30
+
31
+ await globalStore.setWif(account.username, wif);
32
+ await globalStore.setTokens(adaptedTokens);
19
33
 
20
34
  const session = useSessionStore()
21
35
  await session.init()
@@ -34,6 +34,8 @@ import { ref, computed } from 'vue'
34
34
  import { useCreateUser } from 'src/features/User/CreateUser'
35
35
  import { Notify, copyToClipboard } from 'quasar'
36
36
  import { useRegistratorStore } from 'src/entities/Registrator'
37
+ import { Classes } from '@coopenomics/sdk'
38
+
37
39
  const store = useRegistratorStore()
38
40
 
39
41
  import { FailAlert } from 'src/shared/api'
@@ -43,7 +45,7 @@ const i_save = ref(false)
43
45
  const account = ref(store.state.account)
44
46
 
45
47
  if (!account.value.private_key || !account.value.public_key || !account.value.username)
46
- account.value = api.generateAccount()
48
+ account.value = new Classes.Account()
47
49
 
48
50
  const email = computed(() => store.state.email)
49
51
  const userData = computed(() => store.state.userData)