@live-change/user-frontend 0.8.66 → 0.8.68

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.
@@ -1,5 +1,5 @@
1
1
  import { useApi, live } from '@live-change/vue3-ssr'
2
- import { computed } from 'vue'
2
+ import { computed, onUnmounted, getCurrentInstance } from 'vue'
3
3
 
4
4
  export function getContactTypes(api = useApi()) {
5
5
  const path = api.fetch
@@ -62,10 +62,13 @@ export function getAccountTypes(api = useApi()) {
62
62
  return accountTypes
63
63
  }
64
64
 
65
- export async function getContacts(api = useApi()) {
65
+ export async function getContacts(context, onUnmountedCb) {
66
+ if(!context) context = getCurrentInstance().appContext
67
+ if(!onUnmountedCb) onUnmountedCb = onUnmounted
68
+ const api = useApi(context)
66
69
  const contactsTypes = getContactTypes(api)
67
70
  for(const contactType of contactsTypes) {
68
- await contactType.fetchContacts()
71
+ await contactType.fetchContacts(context, onUnmountedCb)
69
72
  }
70
73
  const contacts = computed(() => contactsTypes.map((c,i) => c.contacts.value.map(v => ({
71
74
  contactType: c.contactType,
@@ -75,10 +78,13 @@ export async function getContacts(api = useApi()) {
75
78
  return contacts
76
79
  }
77
80
 
78
- export async function getAccounts(api = useApi()) {
81
+ export async function getAccounts(context, onUnmountedCb) {
82
+ if(!context) context = getCurrentInstance().appContext
83
+ if(!onUnmountedCb) onUnmountedCb = onUnmounted
84
+ const api = useApi(context)
79
85
  const accountTypes = getAccountTypes(api)
80
86
  for(const accountType of accountTypes) {
81
- await accountType.fetchAccounts()
87
+ await accountType.fetchAccounts(context, onUnmountedCb)
82
88
  }
83
89
  const accounts = computed(() => accountTypes.map((c,i) => c.accounts.value.map(v => ({
84
90
  accountType: c.contactType,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@live-change/user-frontend",
3
- "version": "0.8.66",
3
+ "version": "0.8.68",
4
4
  "scripts": {
5
5
  "memDev": "node --inspect --expose-gc server/start.js memDev --enableSessions --initScript ./init.js --dbAccess",
6
6
  "localDevInit": "rm tmp.db; node server/start.js localDev --enableSessions --initScript ./init.js",
@@ -22,29 +22,29 @@
22
22
  },
23
23
  "type": "module",
24
24
  "dependencies": {
25
- "@live-change/cli": "^0.8.66",
26
- "@live-change/dao": "^0.8.66",
27
- "@live-change/dao-vue3": "^0.8.66",
28
- "@live-change/dao-websocket": "^0.8.66",
29
- "@live-change/email-service": "^0.8.66",
30
- "@live-change/framework": "^0.8.66",
31
- "@live-change/identicon-service": "^0.8.66",
32
- "@live-change/image-frontend": "^0.8.66",
33
- "@live-change/message-authentication-service": "^0.8.66",
34
- "@live-change/notification-service": "^0.8.66",
35
- "@live-change/password-authentication-service": "^0.8.66",
36
- "@live-change/pattern": "^0.8.66",
37
- "@live-change/secret-code-service": "^0.8.66",
38
- "@live-change/secret-link-service": "^0.8.66",
39
- "@live-change/security-frontend": "^0.8.66",
40
- "@live-change/security-service": "^0.8.66",
41
- "@live-change/session-service": "^0.8.66",
42
- "@live-change/timer-service": "^0.8.66",
43
- "@live-change/upload-service": "^0.8.66",
44
- "@live-change/user-identification-service": "^0.8.66",
45
- "@live-change/user-service": "^0.8.66",
46
- "@live-change/vue3-components": "^0.8.66",
47
- "@live-change/vue3-ssr": "^0.8.66",
25
+ "@live-change/cli": "^0.8.68",
26
+ "@live-change/dao": "^0.8.68",
27
+ "@live-change/dao-vue3": "^0.8.68",
28
+ "@live-change/dao-websocket": "^0.8.68",
29
+ "@live-change/email-service": "^0.8.68",
30
+ "@live-change/framework": "^0.8.68",
31
+ "@live-change/identicon-service": "^0.8.68",
32
+ "@live-change/image-frontend": "^0.8.68",
33
+ "@live-change/message-authentication-service": "^0.8.68",
34
+ "@live-change/notification-service": "^0.8.68",
35
+ "@live-change/password-authentication-service": "^0.8.68",
36
+ "@live-change/pattern": "^0.8.68",
37
+ "@live-change/secret-code-service": "^0.8.68",
38
+ "@live-change/secret-link-service": "^0.8.68",
39
+ "@live-change/security-frontend": "^0.8.68",
40
+ "@live-change/security-service": "^0.8.68",
41
+ "@live-change/session-service": "^0.8.68",
42
+ "@live-change/timer-service": "^0.8.68",
43
+ "@live-change/upload-service": "^0.8.68",
44
+ "@live-change/user-identification-service": "^0.8.68",
45
+ "@live-change/user-service": "^0.8.68",
46
+ "@live-change/vue3-components": "^0.8.68",
47
+ "@live-change/vue3-ssr": "^0.8.68",
48
48
  "@vueuse/core": "^10.11.0",
49
49
  "codeceptjs-assert": "^0.0.5",
50
50
  "codeceptjs-video-helper": "0.1.3",
@@ -65,7 +65,7 @@
65
65
  "wtfnode": "^0.9.1"
66
66
  },
67
67
  "devDependencies": {
68
- "@live-change/codeceptjs-helper": "^0.8.66",
68
+ "@live-change/codeceptjs-helper": "^0.8.68",
69
69
  "codeceptjs": "^3.6.5",
70
70
  "generate-password": "1.7.1",
71
71
  "playwright": "^1.41.2",
@@ -76,5 +76,5 @@
76
76
  "author": "Michał Łaszczewski <michal@laszczewski.pl>",
77
77
  "license": "BSD-3-Clause",
78
78
  "description": "",
79
- "gitHead": "33fa71ec087690903b109e2c0a2cf1de886449f7"
79
+ "gitHead": "9f34ce84625f32092de0d93dcd19e4e4982982bd"
80
80
  }