Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ginkgo
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
vjrj
ginkgo
Commits
b673270f
Commit
b673270f
authored
1 year ago
by
vjrj
Browse files
Options
Downloads
Patches
Plain Diff
More exception catching in back task
parent
443908af
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/ui/ui_helpers.dart
+38
-31
38 additions, 31 deletions
lib/ui/ui_helpers.dart
with
38 additions
and
31 deletions
lib/ui/ui_helpers.dart
+
38
−
31
View file @
b673270f
...
...
@@ -260,39 +260,46 @@ void initGetItAll() {
}
Future
<
void
>
fetchTransactionsFromBackground
([
bool
init
=
true
])
async
{
if
(
init
)
{
await
hydratedInit
();
if
(
SharedPreferencesHelper
()
.
cards
.
isEmpty
)
{
await
SharedPreferencesHelper
()
.
init
();
}
try
{
initGetItAll
();
await
NotificationController
.
initializeLocalNotifications
();
}
catch
(
e
)
{
// We should try to do this better
if
(
inDevelopment
)
{
NotificationController
.
notify
(
title:
'Background process failed'
,
desc:
e
.
toString
(),
id:
DateTime
.
now
()
.
toIso8601String
());
try
{
if
(
init
)
{
await
hydratedInit
();
if
(
SharedPreferencesHelper
()
.
cards
.
isEmpty
)
{
await
SharedPreferencesHelper
()
.
init
();
}
try
{
initGetItAll
();
await
NotificationController
.
initializeLocalNotifications
();
}
catch
(
e
)
{
// We should try to do this better
loggerDev
(
e
.
toString
());
if
(
inDevelopment
)
{
NotificationController
.
notify
(
title:
'Background process failed'
,
desc:
e
.
toString
(),
id:
DateTime
.
now
()
.
toIso8601String
());
}
}
}
}
loggerDev
(
'Initialized background context'
);
final
GetIt
getIt
=
GetIt
.
instance
;
final
AppCubit
appCubit
=
getIt
.
get
<
AppCubit
>();
final
MultiWalletTransactionCubit
transCubit
=
getIt
.
get
<
MultiWalletTransactionCubit
>();
final
NodeListCubit
nodeListCubit
=
getIt
.
get
<
NodeListCubit
>();
for
(
final
CesiumCard
card
in
SharedPreferencesHelper
()
.
cards
)
{
loggerDev
(
'Fetching transactions for
${card.pubKey}
in background'
);
transCubit
.
fetchTransactions
(
nodeListCubit
,
appCubit
,
pubKey:
card
.
pubKey
);
}
if
(
inDevelopment
)
{
NotificationController
.
notify
(
title:
'Background process ended correctly'
,
desc:
''
,
id:
DateTime
.
now
()
.
toIso8601String
());
loggerDev
(
'Initialized background context'
);
final
GetIt
getIt
=
GetIt
.
instance
;
final
AppCubit
appCubit
=
getIt
.
get
<
AppCubit
>();
final
MultiWalletTransactionCubit
transCubit
=
getIt
.
get
<
MultiWalletTransactionCubit
>();
final
NodeListCubit
nodeListCubit
=
getIt
.
get
<
NodeListCubit
>();
for
(
final
CesiumCard
card
in
SharedPreferencesHelper
()
.
cards
)
{
loggerDev
(
'Fetching transactions for
${card.pubKey}
in background'
);
transCubit
.
fetchTransactions
(
nodeListCubit
,
appCubit
,
pubKey:
card
.
pubKey
);
}
if
(
inDevelopment
)
{
NotificationController
.
notify
(
title:
'Background process ended correctly'
,
desc:
''
,
id:
DateTime
.
now
()
.
toIso8601String
());
}
}
catch
(
e
)
{
// We should try to do this better
loggerDev
(
e
.
toString
());
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment