Открыть боковую панель
Teknokomo
universo-react
Коммиты
8af064b6
Не подтверждена
Коммит
8af064b6
создал
Май 12, 2024
по автору
pengx17
Просмотр файлов
fix: should not reset identity on app start (#6895)
владелец
b8a1fbd6
Изменения
1
Скрыть пробелы
Построчно
Рядом
packages/frontend/core/src/modules/telemetry/services/telemetry.ts
Просмотр файла @
8af064b6
...
@@ -7,10 +7,12 @@ import {
...
@@ -7,10 +7,12 @@ import {
type
AuthAccountInfo
,
type
AuthAccountInfo
,
type
AuthService
,
type
AuthService
,
}
from
'
../../cloud
'
;
}
from
'
../../cloud
'
;
import
{
AccountLoggedOut
}
from
'
../../cloud/services/auth
'
;
import
{
UserQuotaChanged
}
from
'
../../cloud/services/user-quota
'
;
import
{
UserQuotaChanged
}
from
'
../../cloud/services/user-quota
'
;
@
OnEvent
(
ApplicationStarted
,
e
=>
e
.
onApplicationStart
)
@
OnEvent
(
ApplicationStarted
,
e
=>
e
.
onApplicationStart
)
@
OnEvent
(
AccountChanged
,
e
=>
e
.
onAccountChanged
)
@
OnEvent
(
AccountChanged
,
e
=>
e
.
updateIdentity
)
@
OnEvent
(
AccountLoggedOut
,
e
=>
e
.
onAccountLoggedOut
)
@
OnEvent
(
UserQuotaChanged
,
e
=>
e
.
onUserQuotaChanged
)
@
OnEvent
(
UserQuotaChanged
,
e
=>
e
.
onUserQuotaChanged
)
export
class
TelemetryService
extends
Service
{
export
class
TelemetryService
extends
Service
{
private
prevQuota
:
NonNullable
<
QuotaQuery
[
'
currentUser
'
]
>
[
'
quota
'
]
|
null
=
private
prevQuota
:
NonNullable
<
QuotaQuery
[
'
currentUser
'
]
>
[
'
quota
'
]
|
null
=
...
@@ -28,21 +30,23 @@ export class TelemetryService extends Service {
...
@@ -28,21 +30,23 @@ export class TelemetryService extends Service {
});
});
}
}
const
account
=
this
.
auth
.
session
.
account$
.
value
;
const
account
=
this
.
auth
.
session
.
account$
.
value
;
this
.
onAccountChanged
(
account
);
this
.
updateIdentity
(
account
);
}
}
onAccountChanged
(
account
:
AuthAccountInfo
|
null
)
{
updateIdentity
(
account
:
AuthAccountInfo
|
null
)
{
if
(
account
===
null
)
{
if
(
!
account
)
{
mixpanel
.
reset
();
return
;
}
else
{
mixpanel
.
reset
();
mixpanel
.
identify
(
account
.
id
);
mixpanel
.
people
.
set
({
$email
:
account
.
email
,
$name
:
account
.
label
,
$avatar
:
account
.
avatar
,
});
}
}
mixpanel
.
identify
(
account
.
id
);
mixpanel
.
people
.
set
({
$email
:
account
.
email
,
$name
:
account
.
label
,
$avatar
:
account
.
avatar
,
});
}
onAccountLoggedOut
()
{
mixpanel
.
reset
();
}
}
onUserQuotaChanged
(
quota
:
NonNullable
<
QuotaQuery
[
'
currentUser
'
]
>
[
'
quota
'
])
{
onUserQuotaChanged
(
quota
:
NonNullable
<
QuotaQuery
[
'
currentUser
'
]
>
[
'
quota
'
])
{
...
...
Редактирование
Предварительный просмотр
Поддерживает Markdown
0%
Попробовать снова
или
прикрепить новый файл
.
Отмена
You are about to add
0
people
to the discussion. Proceed with caution.
Сначала завершите редактирование этого сообщения!
Отмена
Пожалуйста,
зарегистрируйтесь
или
войдите
чтобы прокомментировать