From 8cee268d13079365695dadedeb3a49d0e454bb03 Mon Sep 17 00:00:00 2001 From: Imran Remtulla Date: Sun, 5 May 2024 21:43:05 -0400 Subject: [PATCH] Fix HTML release asset download (#1578) --- lib/pages/app.dart | 5 ++--- lib/providers/apps_provider.dart | 1 + 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/pages/app.dart b/lib/pages/app.dart index 1497475..3ed140c 100644 --- a/lib/pages/app.dart +++ b/lib/pages/app.dart @@ -175,9 +175,8 @@ class _AppPageState extends State { tr('downloadX', args: [tr('releaseAsset').toLowerCase()]), textAlign: TextAlign.center, style: Theme.of(context).textTheme.labelSmall!.copyWith( - decoration: - changeLogFn != null ? TextDecoration.underline : null, - fontStyle: changeLogFn != null ? FontStyle.italic : null, + decoration: TextDecoration.underline, + fontStyle: FontStyle.italic, ), ), ), diff --git a/lib/providers/apps_provider.dart b/lib/providers/apps_provider.dart index 5b39320..a7a05b5 100644 --- a/lib/providers/apps_provider.dart +++ b/lib/providers/apps_provider.dart @@ -223,6 +223,7 @@ Future downloadFile(String url, String fileName, bool fileNameHasExt, if (url.toLowerCase().endsWith('.apk') && ext != 'apk') { ext = 'apk'; } + fileName = fileName.split('/').last; // Ensure the fileName is a file name File downloadedFile = File('$destDir/$fileName.$ext'); if (fileNameHasExt) { // If the user says the filename already has an ext, ignore whatever you inferred from above