Only allow path override for senders
continuous-integration/drone/pr Build is pending Details

This commit is contained in:
Sarah Jamie Lewis 2022-01-20 14:42:45 -08:00
parent 6364ebffc6
commit 13c1a52442
1 changed files with 10 additions and 7 deletions

View File

@ -255,13 +255,16 @@ class ProfileInfoState extends ChangeNotifier {
// set the download path for the sender
void downloadSetPathForSender(String fileKey, String path) {
this._downloads[fileKey] = FileDownloadProgress(1, DateTime.now());
this._downloads[fileKey]!.timeEnd = DateTime.now();
this._downloads[fileKey]!.chunksDownloaded = 1;
this._downloads[fileKey]!.gotManifest = true;
this._downloads[fileKey]!.complete = true;
this._downloads[fileKey]!.downloadedTo = path;
notifyListeners();
// only allow this override if we are the sender...
if (this._downloads.containsKey(fileKey) == false) {
this._downloads[fileKey] = FileDownloadProgress(1, DateTime.now());
this._downloads[fileKey]!.timeEnd = DateTime.now();
this._downloads[fileKey]!.chunksDownloaded = 1;
this._downloads[fileKey]!.gotManifest = true;
this._downloads[fileKey]!.complete = true;
this._downloads[fileKey]!.downloadedTo = path;
notifyListeners();
}
}
String? downloadFinalPath(String fileKey) {