Skip to content
This repository was archived by the owner on Feb 19, 2021. It is now read-only.

Commit 4c4aca3

Browse files
committed
Disable shared flg
1 parent 6b3ef73 commit 4c4aca3

3 files changed

Lines changed: 4 additions & 14 deletions

File tree

Covid19Radar/Covid19Radar/Model/PositiveDiagnosisState.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,5 @@ public class PositiveDiagnosisState
88

99
public DateTimeOffset DiagnosisDate { get; set; }
1010

11-
public bool Shared { get; set; }
1211
}
1312
}

Covid19Radar/Covid19Radar/Model/UserDataModel.cs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ public void AddDiagnosis(string diagnosisUid, DateTimeOffset submissionDate)
114114
return;
115115

116116
// Remove ones that were not submitted as the new one is better
117-
PositiveDiagnoses.RemoveAll(d => !d.Shared);
117+
PositiveDiagnoses.Clear();
118118

119119
PositiveDiagnoses.Add(new PositiveDiagnosisState
120120
{
@@ -128,13 +128,6 @@ public void ClearDiagnosis()
128128

129129
public PositiveDiagnosisState LatestDiagnosis
130130
=> PositiveDiagnoses
131-
.Where(d => d.Shared)
132-
.OrderByDescending(p => p.DiagnosisDate)
133-
.FirstOrDefault();
134-
135-
public PositiveDiagnosisState PendingDiagnosis
136-
=> PositiveDiagnoses
137-
.Where(d => !d.Shared)
138131
.OrderByDescending(p => p.DiagnosisDate)
139132
.FirstOrDefault();
140133

Covid19Radar/Covid19Radar/Services/ExposureNotificationHandler.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -222,14 +222,14 @@ public async Task FetchExposureKeyBatchFilesFromServerAsync(Func<IEnumerable<str
222222
// this will be called when the user is submitting a diagnosis and the local keys need to go to the server
223223
public async Task UploadSelfExposureKeysToServerAsync(IEnumerable<TemporaryExposureKey> temporaryExposureKeys)
224224
{
225-
var pendingDiagnosis = userData.PendingDiagnosis;
225+
var latestDiagnosis = userData.LatestDiagnosis;
226226

227-
if (pendingDiagnosis == null || string.IsNullOrEmpty(pendingDiagnosis.DiagnosisUid))
227+
if (latestDiagnosis == null || string.IsNullOrEmpty(latestDiagnosis.DiagnosisUid))
228228
{
229229
throw new InvalidOperationException();
230230
}
231231

232-
var selfDiag = await CreateSubmissionAsync(temporaryExposureKeys, pendingDiagnosis);
232+
var selfDiag = await CreateSubmissionAsync(temporaryExposureKeys, latestDiagnosis);
233233

234234
HttpStatusCode httpStatusCode = await httpDataService.PutSelfExposureKeysAsync(selfDiag);
235235
if (httpStatusCode == HttpStatusCode.NotAcceptable)
@@ -256,8 +256,6 @@ await UserDialogs.Instance.AlertAsync(
256256
Resources.AppResources.ButtonOk);
257257
throw new InvalidOperationException();
258258
}
259-
// Update pending status
260-
pendingDiagnosis.Shared = true;
261259
await userDataService.SetAsync(userData);
262260
}
263261

0 commit comments

Comments
 (0)