Compare commits

...

6 Commits

Author SHA1 Message Date
69ccefcf1a Merge pull request #382 from atilluF/main
Update it.json
2023-03-25 00:56:52 -04:00
d3932f317d Merge pull request #384 from ImranR98/dev
Bugfixes: "Return After Delete" (#359) and No Redirect if Navigating During App Addition
2023-03-25 00:56:16 -04:00
895deeead5 Increment version 2023-03-25 00:54:34 -04:00
4c04af3868 Bugfix: App add doesn't redirect if nav away during add 2023-03-25 00:54:12 -04:00
07c490bb0e Fixed "return after delete" bug (#359) 2023-03-25 00:47:26 -04:00
a081d553bb Update it.json 2023-03-24 20:11:03 +01:00
5 changed files with 21 additions and 14 deletions

View File

@ -217,9 +217,9 @@
"releaseDateAsVersionExplanation": "Questa opzione dovrebbe essere usata solo per le App in cui il rilevamento della versione non funziona correttamente, ma è disponibile una data di rilascio.", "releaseDateAsVersionExplanation": "Questa opzione dovrebbe essere usata solo per le App in cui il rilevamento della versione non funziona correttamente, ma è disponibile una data di rilascio.",
"changes": "Novità", "changes": "Novità",
"releaseDate": "Data di rilascio", "releaseDate": "Data di rilascio",
"importFromURLsInFile": "Import from URLs in File (like OPML)", "importFromURLsInFile": "Importa da URL in file (come OPML)",
"versionDetection": "Version Detection", "versionDetection": "Rilevamento di versione",
"standardVersionDetection": "Standard version detection", "standardVersionDetection": "Rilevamento di versione standard",
"removeAppQuestion": { "removeAppQuestion": {
"one": "Rimuovere l'App?", "one": "Rimuovere l'App?",
"other": "Rimuovere le App?" "other": "Rimuovere le App?"

View File

@ -21,7 +21,7 @@ import 'package:easy_localization/src/easy_localization_controller.dart';
// ignore: implementation_imports // ignore: implementation_imports
import 'package:easy_localization/src/localization.dart'; import 'package:easy_localization/src/localization.dart';
const String currentVersion = '0.11.13'; const String currentVersion = '0.11.14';
const String currentReleaseTag = const String currentReleaseTag =
'v$currentVersion-beta'; // KEEP THIS IN SYNC WITH GITHUB RELEASES 'v$currentVersion-beta'; // KEEP THIS IN SYNC WITH GITHUB RELEASES
@ -210,7 +210,7 @@ class _ObtainiumState extends State<Obtainium> {
{'includePrereleases': true}, {'includePrereleases': true},
null, null,
false) false)
]); ], onlyIfExists: false);
} }
if (!supportedLocales if (!supportedLocales
.map((e) => e.languageCode) .map((e) => e.languageCode)

View File

@ -149,14 +149,14 @@ class _AddAppPageState extends State<AddAppPage> {
app.installedVersion = app.latestVersion; app.installedVersion = app.latestVersion;
} }
app.categories = pickedCategories; app.categories = pickedCategories;
await appsProvider.saveApps([app]); await appsProvider.saveApps([app], onlyIfExists: false);
return app; return app;
} }
}() }()
.then((app) { .then((app) {
if (app != null) { if (app != null) {
Navigator.push(context, Navigator.push(globalNavigatorKey.currentContext ?? context,
MaterialPageRoute(builder: (context) => AppPage(appId: app.id))); MaterialPageRoute(builder: (context) => AppPage(appId: app.id)));
} }
}).catchError((e) { }).catchError((e) {

View File

@ -628,7 +628,8 @@ class AppsProvider with ChangeNotifier {
} }
Future<void> saveApps(List<App> apps, Future<void> saveApps(List<App> apps,
{bool attemptToCorrectInstallStatus = true}) async { {bool attemptToCorrectInstallStatus = true,
bool onlyIfExists = true}) async {
attemptToCorrectInstallStatus = attemptToCorrectInstallStatus =
attemptToCorrectInstallStatus && (await doesInstalledAppsPluginWork()); attemptToCorrectInstallStatus && (await doesInstalledAppsPluginWork());
for (var app in apps) { for (var app in apps) {
@ -639,9 +640,15 @@ class AppsProvider with ChangeNotifier {
} }
File('${(await getAppsDir()).path}/${app.id}.json') File('${(await getAppsDir()).path}/${app.id}.json')
.writeAsStringSync(jsonEncode(app.toJson())); .writeAsStringSync(jsonEncode(app.toJson()));
this.apps.update( try {
app.id, (value) => AppInMemory(app, value.downloadProgress, info), this.apps.update(
ifAbsent: () => AppInMemory(app, null, info)); app.id, (value) => AppInMemory(app, value.downloadProgress, info),
ifAbsent: onlyIfExists ? null : () => AppInMemory(app, null, info));
} catch (e) {
if (e is! ArgumentError || e.name != 'key') {
rethrow;
}
}
} }
notifyListeners(); notifyListeners();
} }
@ -824,7 +831,7 @@ class AppsProvider with ChangeNotifier {
a.installedVersion = apps[a.id]?.app.installedVersion; a.installedVersion = apps[a.id]?.app.installedVersion;
} }
} }
await saveApps(importedApps); await saveApps(importedApps, onlyIfExists: false);
notifyListeners(); notifyListeners();
return importedApps.length; return importedApps.length;
} }
@ -844,7 +851,7 @@ class AppsProvider with ChangeNotifier {
if (apps.containsKey(app.id)) { if (apps.containsKey(app.id)) {
errorsMap.addAll({app.id: tr('appAlreadyAdded')}); errorsMap.addAll({app.id: tr('appAlreadyAdded')});
} else { } else {
await saveApps([app]); await saveApps([app], onlyIfExists: false);
} }
} }
List<List<String>> errors = List<List<String>> errors =

View File

@ -17,7 +17,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# In Windows, build-name is used as the major, minor, and patch parts # In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix. # of the product and file versions while build-number is used as the build suffix.
version: 0.11.13+134 # When changing this, update the tag in main() accordingly version: 0.11.14+135 # When changing this, update the tag in main() accordingly
environment: environment:
sdk: '>=2.18.2 <3.0.0' sdk: '>=2.18.2 <3.0.0'