Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
BeSafePlus
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
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
Sebastian Kristensen
BeSafePlus
Commits
e3303fe0
Commit
e3303fe0
authored
1 week ago
by
MarcusStorvangJonassen
Browse files
Options
Downloads
Patches
Plain Diff
A potential fix for the delay for now
parent
bfc5929c
No related branches found
Branches containing commit
No related tags found
1 merge request
!37
Frontend ui
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
BeSafePlus/ViewModels/ActivityHistoryViewModel.cs
+10
-12
10 additions, 12 deletions
BeSafePlus/ViewModels/ActivityHistoryViewModel.cs
BeSafePlus/Views/ActivityHistoryPage.xaml.cs
+8
-4
8 additions, 4 deletions
BeSafePlus/Views/ActivityHistoryPage.xaml.cs
with
18 additions
and
16 deletions
BeSafePlus/ViewModels/ActivityHistoryViewModel.cs
+
10
−
12
View file @
e3303fe0
...
...
@@ -74,9 +74,9 @@ namespace BeSafePlus.ViewModels
}
}
}
private
void
UpdateSteps
(
int
steps
)
private
async
void
UpdateSteps
(
int
steps
)
{
MainThread
.
Begin
InvokeOnMainThread
(
()
=>
await
MainThread
.
InvokeOnMainThread
Async
(
async
()
=>
{
AccumulatedSteps
=
steps
;
...
...
@@ -101,15 +101,7 @@ namespace BeSafePlus.ViewModels
TotalStepsThisWeek
=
WeeklyStepData
.
Sum
(
data
=>
data
.
Steps
);
Task
.
Run
(
async
()
=>
{
await
LoadMonthlySteps
();
MainThread
.
BeginInvokeOnMainThread
(()
=>
{
OnPropertyChanged
(
nameof
(
TotalStepsThisMonth
));
});
});
await
LoadMonthlySteps
();
OnPropertyChanged
(
nameof
(
WeeklyStepData
));
...
...
@@ -146,7 +138,13 @@ namespace BeSafePlus.ViewModels
public
int
TotalStepsThisMonth
{
get
=>
_totalStepsThisMonth
;
set
=>
SetProperty
(
ref
_totalStepsThisMonth
,
value
);
set
{
if
(
SetProperty
(
ref
_totalStepsThisMonth
,
value
))
{
OnPropertyChanged
(
nameof
(
TotalStepsThisMonth
));
}
}
}
public
string
WeekLabel
=>
GetWeekLabel
();
public
string
MonthLabel
=>
GetMonthLabel
();
...
...
This diff is collapsed.
Click to expand it.
BeSafePlus/Views/ActivityHistoryPage.xaml.cs
+
8
−
4
View file @
e3303fe0
...
...
@@ -40,13 +40,17 @@ namespace BeSafePlus
{
base
.
OnAppearing
();
await
_viewModel
.
LoadStepGoal
();
var
loadStepGoalTask
=
_viewModel
.
LoadStepGoal
();
await
_viewModel
.
LoadWeeklySteps
();
var
loadWeeklyStepsTask
=
_viewModel
.
LoadWeeklySteps
();
await
_viewModel
.
LoadMonthlySteps
();
var
loadMonthlyStepsTask
=
_viewModel
.
LoadMonthlySteps
();
_viewModel
.
AccumulatedSteps
=
await
_viewModel
.
GetStepCount
();
var
getStepCountTask
=
_viewModel
.
GetStepCount
();
await
Task
.
WhenAll
(
loadStepGoalTask
,
loadWeeklyStepsTask
,
loadMonthlyStepsTask
,
getStepCountTask
);
_viewModel
.
AccumulatedSteps
=
await
getStepCountTask
;
LoadChart
();
...
...
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