2
0
mirror of https://github.com/inventree/inventree-app.git synced 2025-06-16 04:05:28 +00:00

Label printing fix (#587)

* Handle blank URL provided for file download

* Improved printing checks

* Auto-select the correct printer
This commit is contained in:
Oliver
2024-12-23 09:57:13 +11:00
committed by GitHub
parent dc8191c3d8
commit bc44b99d43
5 changed files with 26 additions and 10 deletions

View File

@ -817,6 +817,11 @@ class InvenTreeAPI {
*/
Future<void> downloadFile(String url, {bool openOnDownload = true}) async {
if (url.isEmpty) {
// No URL provided for download
return;
}
// Find the local downlods directory
final Directory dir = await getTemporaryDirectory();
@ -1538,7 +1543,7 @@ class InvenTreeAPI {
return setting.value;
}
final response = await InvenTreeGlobalSetting().getModel(key);
final response = await InvenTreeUserSetting().getModel(key);
if (response is InvenTreeUserSetting) {
response.lastReload = DateTime.now();