image previews - dan comments - wip

This commit is contained in:
erinn 2021-12-18 17:43:32 -08:00
parent c78dbf0ac3
commit d329e7cc06
3 changed files with 4 additions and 3 deletions

View File

@ -49,12 +49,14 @@ abstract class Cwtch {
void ShareFile(String profile, int handle, String filepath); void ShareFile(String profile, int handle, String filepath);
// ignore: non_constant_identifier_names // ignore: non_constant_identifier_names
void DownloadFile(String profile, int handle, String filepath, String manifestpath, String filekey); void DownloadFile(String profile, int handle, String filepath, String manifestpath, String filekey);
// android-only
// ignore: non_constant_identifier_names // ignore: non_constant_identifier_names
void CreateDownloadableFile(String profile, int handle, String filenameSuggestion, String filekey); void CreateDownloadableFile(String profile, int handle, String filenameSuggestion, String filekey);
// ignore: non_constant_identifier_names // ignore: non_constant_identifier_names
void CheckDownloadStatus(String profile, String fileKey); void CheckDownloadStatus(String profile, String fileKey);
// ignore: non_constant_identifier_names // ignore: non_constant_identifier_names
void VerifyOrResumeDownload(String profile, int handle, String filekey); void VerifyOrResumeDownload(String profile, int handle, String filekey);
// android-only
// ignore: non_constant_identifier_names // ignore: non_constant_identifier_names
void ExportPreviewedFile(String sourceFile, String suggestion); void ExportPreviewedFile(String sourceFile, String suggestion);

View File

@ -700,7 +700,7 @@ class CwtchFfi implements Cwtch {
@override @override
String defaultDownloadPath() { String defaultDownloadPath() {
Map<String, String> envVars = Platform.environment; Map<String, String> envVars = Platform.environment;
return path.join(envVars['HOME']!, "Downloads"); return path.join(envVars[Platform.isWindows ? 'UserProfile' : 'HOME']!, "Downloads");
} }
@override @override

View File

@ -399,15 +399,14 @@ class ProfileInfoState extends ChangeNotifier {
if (progress < 0) { if (progress < 0) {
this._downloads[fileKey]!.interrupted = true; this._downloads[fileKey]!.interrupted = true;
} }
notifyListeners();
} else { } else {
if (this._downloads[fileKey]!.interrupted) { if (this._downloads[fileKey]!.interrupted) {
this._downloads[fileKey]!.interrupted = false; this._downloads[fileKey]!.interrupted = false;
} }
this._downloads[fileKey]!.chunksDownloaded = progress; this._downloads[fileKey]!.chunksDownloaded = progress;
this._downloads[fileKey]!.chunksTotal = numChunks; this._downloads[fileKey]!.chunksTotal = numChunks;
notifyListeners();
} }
notifyListeners();
} }
void downloadMarkManifest(String fileKey) { void downloadMarkManifest(String fileKey) {