Skip to content
Projects
Groups
Snippets
Help
Sign in / Register
Toggle navigation
Minds Frontend
Project overview
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
401
Merge Requests
64
CI / CD
Security & Compliance
Packages
Analytics
Wiki
Snippets
Members
Collapse sidebar
Close sidebar
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Minds
Minds Frontend
Commits
3691f0e7
Commit
3691f0e7
authored
42 minutes ago
by
Olivia Madrid
Browse files
Options
Download
dont detect changes on destroyed views
parent
4f3fa573
epic/wallet-80
1 merge request
!686
WIP: Epic/wallet 80
Pipeline
#116007640
running with stages
Changes
6
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
65 additions
and
38 deletions
+65
-38
src/app/common/components/shadowbox-header/shadowbox-header.component.ts
View file @
3691f0e7
...
...
@@ -7,8 +7,8 @@ import {
ViewChild
,
ElementRef
,
HostListener
,
ViewRef
,
}
from
'
@angular/core
'
;
import
{
Subscription
}
from
'
rxjs
'
;
import
{
Inject
,
PLATFORM_ID
}
from
'
@angular/core
'
;
import
{
isPlatformBrowser
}
from
'
@angular/common
'
;
import
{
horizontallyScrollElementIntoView
}
from
'
../../../helpers/scrollable-container-visibility
'
;
...
...
@@ -29,8 +29,6 @@ export class ShadowboxHeaderComponent implements AfterViewInit {
firstMetricEl
;
activeMetricEl
;
tabsSubscription
:
Subscription
;
tabsArray
;
childClientWidth
:
number
;
...
...
@@ -116,7 +114,9 @@ export class ShadowboxHeaderComponent implements AfterViewInit {
this
.
container
.
scrollLeft
>=
0
&&
!
this
.
isAtScrollEnd
;
}
this
.
detectChanges
();
if
(
!
(
this
.
cd
as
ViewRef
).
destroyed
)
{
this
.
detectChanges
();
}
}
slide
(
direction
)
{
...
...
This diff is collapsed.
src/app/modules/wallet/v2/balance-cash/balance-cash.component.ts
View file @
3691f0e7
...
...
@@ -6,18 +6,20 @@ import {
Input
,
Output
,
EventEmitter
,
OnDestroy
,
}
from
'
@angular/core
'
;
import
{
Client
}
from
'
../../../../services/api/client
'
;
import
{
Session
}
from
'
../../../../services/session
'
;
import
{
WalletDashboardService
}
from
'
../dashboard.service
'
;
import
{
ActivatedRoute
,
ParamMap
}
from
'
@angular/router
'
;
import
*
as
moment
from
'
moment
'
;
import
{
Subscription
}
from
'
rxjs
'
;
@
Component
({
selector
:
'
m-walletBalance--cash
'
,
templateUrl
:
'
./balance-cash.component.html
'
,
changeDetection
:
ChangeDetectionStrategy
.
OnPush
,
})
export
class
WalletBalanceCashComponent
implements
OnInit
{
export
class
WalletBalanceCashComponent
implements
OnInit
,
OnDestroy
{
inProgress
:
boolean
=
true
;
stripeAccount
;
hasAccount
:
boolean
=
true
;
...
...
@@ -26,6 +28,7 @@ export class WalletBalanceCashComponent implements OnInit {
nextPayoutDate
=
''
;
onSettingsTab
:
boolean
=
false
;
currency
=
'
usd
'
;
paramsSubscription
:
Subscription
;
@
Output
()
scrollToCashSettings
:
EventEmitter
<
any
>
=
new
EventEmitter
();
constructor
(
...
...
@@ -37,14 +40,22 @@ export class WalletBalanceCashComponent implements OnInit {
)
{}
ngOnInit
()
{
this
.
route
.
paramMap
.
subscribe
((
params
:
ParamMap
)
=>
{
this
.
onSettingsTab
=
params
.
get
(
'
view
'
)
===
'
settings
'
;
this
.
detectChanges
();
});
this
.
paramsSubscription
=
this
.
route
.
paramMap
.
subscribe
(
(
params
:
ParamMap
)
=>
{
this
.
onSettingsTab
=
params
.
get
(
'
view
'
)
===
'
settings
'
;
this
.
detectChanges
();
}
);
this
.
load
();
}
ngOnDestroy
()
{
if
(
this
.
paramsSubscription
)
{
this
.
paramsSubscription
.
unsubscribe
();
}
}
async
load
()
{
// TODOOJM $stripe - this is not accurate for all stripe accounts
this
.
nextPayoutDate
=
moment
()
...
...
This diff is collapsed.
src/app/modules/wallet/v2/balance-tokens/balance-tokens.component.ts
View file @
3691f0e7
...
...
@@ -10,7 +10,6 @@ import {
}
from
'
@angular/core
'
;
import
{
isPlatformBrowser
}
from
'
@angular/common
'
;
import
{
Client
}
from
'
../../../../services/api/client
'
;
import
{
Subscription
}
from
'
rxjs
'
;
import
{
Session
}
from
'
../../../../services/session
'
;
import
{
WalletDashboardService
}
from
'
../dashboard.service
'
;
import
{
FormToastService
}
from
'
../../../../common/services/form-toast.service
'
;
...
...
@@ -39,7 +38,6 @@ export class WalletBalanceTokensV2Component implements OnInit, OnDestroy {
.
format
(
'
h:mma
'
);
nextPayoutDate
=
0
;
estimatedTokenPayout
;
payoutSubscription
:
Subscription
;
constructor
(
protected
client
:
Client
,
protected
cd
:
ChangeDetectorRef
,
...
...
@@ -70,9 +68,6 @@ export class WalletBalanceTokensV2Component implements OnInit, OnDestroy {
if
(
this
.
updateTimer$
)
{
clearInterval
(
this
.
updateTimer$
);
}
if
(
this
.
payoutSubscription
)
{
this
.
payoutSubscription
.
unsubscribe
();
}
}
async
getPayout
()
{
...
...
This diff is collapsed.
src/app/modules/wallet/v2/dashboard.component.ts
View file @
3691f0e7
...
...
@@ -8,6 +8,7 @@ import {
ViewChild
,
ElementRef
,
AfterViewInit
,
OnDestroy
,
}
from
'
@angular/core
'
;
import
{
isPlatformBrowser
}
from
'
@angular/common
'
;
...
...
@@ -25,7 +26,7 @@ import { FeaturesService } from '../../../services/features.service';
templateUrl
:
'
./dashboard.component.html
'
,
changeDetection
:
ChangeDetectionStrategy
.
OnPush
,
})
export
class
WalletDashboardComponent
implements
OnInit
{
export
class
WalletDashboardComponent
implements
OnInit
,
OnDestroy
{
@
ViewChild
(
'
tokensSettings
'
,
{
static
:
false
})
tokenSettingsEl
:
ElementRef
;
@
ViewChild
(
'
cashSettings
'
,
{
static
:
false
})
cashSettingsEl
:
ElementRef
;
@
ViewChild
(
'
dashboardViews
'
,
{
static
:
false
})
...
...
@@ -79,31 +80,39 @@ export class WalletDashboardComponent implements OnInit {
this
.
wallet
=
this
.
walletService
.
getWallet
();
this
.
route
.
paramMap
.
subscribe
((
params
:
ParamMap
)
=>
{
const
currencyParam
=
params
.
get
(
'
currency
'
);
const
viewParam
=
params
.
get
(
'
view
'
);
this
.
activeCurrencyId
=
currencyParam
;
if
(
!
this
.
views
[
this
.
activeCurrencyId
])
{
this
.
activeCurrencyId
=
'
tokens
'
;
this
.
router
.
navigate
([
'
/wallet/tokens
'
]);
}
if
(
viewParam
&&
this
.
views
[
this
.
activeCurrencyId
].
find
(
v
=>
v
.
id
===
viewParam
)
)
{
this
.
activeViewId
=
viewParam
;
}
else
{
this
.
activeViewId
=
this
.
views
[
this
.
activeCurrencyId
][
0
].
id
;
this
.
updateView
(
this
.
activeViewId
);
this
.
paramsSubscription
=
this
.
route
.
paramMap
.
subscribe
(
(
params
:
ParamMap
)
=>
{
const
currencyParam
=
params
.
get
(
'
currency
'
);
const
viewParam
=
params
.
get
(
'
view
'
);
this
.
activeCurrencyId
=
currencyParam
;
if
(
!
this
.
views
[
this
.
activeCurrencyId
])
{
this
.
activeCurrencyId
=
'
tokens
'
;
this
.
router
.
navigate
([
'
/wallet/tokens
'
]);
}
if
(
viewParam
&&
this
.
views
[
this
.
activeCurrencyId
].
find
(
v
=>
v
.
id
===
viewParam
)
)
{
this
.
activeViewId
=
viewParam
;
}
else
{
this
.
activeViewId
=
this
.
views
[
this
.
activeCurrencyId
][
0
].
id
;
this
.
updateView
(
this
.
activeViewId
);
}
this
.
detectChanges
();
}
this
.
detectChanges
();
});
);
this
.
setCurrencies
();
this
.
detectChanges
();
}
ngOnDestroy
()
{
if
(
this
.
paramsSubscription
)
{
this
.
paramsSubscription
.
unsubscribe
();
}
}
setCurrencies
()
{
const
headerCurrencies
=
[
'
tokens
'
,
'
cash
'
,
'
eth
'
,
'
btc
'
];
headerCurrencies
.
forEach
(
currency
=>
{
...
...
This diff is collapsed.
src/app/modules/wallet/v2/settings-tokens/settings-tokens.component.ts
View file @
3691f0e7
...
...
@@ -9,6 +9,7 @@ import {
EventEmitter
,
Inject
,
PLATFORM_ID
,
ViewRef
,
}
from
'
@angular/core
'
;
import
{
isPlatformBrowser
}
from
'
@angular/common
'
;
import
{
ConfigsService
}
from
'
../../../../common/services/configs.service
'
;
...
...
@@ -164,7 +165,9 @@ export class WalletSettingsTokensComponent implements OnInit, OnDestroy {
this
.
generatedAccount
=
null
;
this
.
addressSetupComplete
.
emit
();
this
.
inProgress
=
false
;
this
.
detectChanges
();
if
(
!
(
this
.
cd
as
ViewRef
).
destroyed
)
{
this
.
detectChanges
();
}
},
1000
);
}
}
...
...
@@ -232,7 +235,9 @@ export class WalletSettingsTokensComponent implements OnInit, OnDestroy {
this
.
detectExternal
();
if
(
isPlatformBrowser
(
this
.
platformId
))
{
this
.
_externalTimer
=
setInterval
(()
=>
{
this
.
detectExternal
();
if
(
!
(
this
.
cd
as
ViewRef
).
destroyed
)
{
this
.
detectExternal
();
}
},
1000
);
}
}
...
...
This diff is collapsed.
src/app/modules/wallet/v2/transactions-tokens/transactions-tokens.component.ts
View file @
3691f0e7
...
...
@@ -3,6 +3,7 @@ import {
ChangeDetectorRef
,
Component
,
OnInit
,
OnDestroy
,
}
from
'
@angular/core
'
;
import
{
ActivatedRoute
,
Router
}
from
'
@angular/router
'
;
import
{
Client
}
from
'
../../../../services/api/client
'
;
...
...
@@ -21,7 +22,7 @@ import { Subscription } from 'rxjs';
templateUrl
:
'
./transactions-tokens.component.html
'
,
changeDetection
:
ChangeDetectionStrategy
.
OnPush
,
})
export
class
WalletTransactionsTokensComponent
implements
OnInit
{
export
class
WalletTransactionsTokensComponent
implements
OnInit
,
OnDestroy
{
init
:
boolean
=
false
;
inProgress
:
boolean
=
true
;
offset
:
string
;
...
...
@@ -98,6 +99,12 @@ export class WalletTransactionsTokensComponent implements OnInit {
this
.
getBalance
();
}
ngOnDestroy
()
{
if
(
this
.
paramsSubscription
)
{
this
.
paramsSubscription
.
unsubscribe
();
}
}
async
getBalance
()
{
const
tokenAccounts
=
await
this
.
walletService
.
getTokenAccounts
();
this
.
runningTotal
=
tokenAccounts
.
tokens
.
balance
;
...
...
This diff is collapsed.
Please
register
or
sign in
to comment