diff --git a/lib/core/rename.dart b/lib/core/rename.dart index 9295397..bac5204 100644 --- a/lib/core/rename.dart +++ b/lib/core/rename.dart @@ -18,13 +18,15 @@ import 'package:once_power/widgets/common/notification.dart'; import 'package:path/path.dart' as path; import 'package:path_provider/path_provider.dart'; -void updateExtension(WidgetRef ref) { +void updateExtension(WidgetRef ref, [bool isUndo = false]) { List files = ref.read(fileListProvider); String inputExt = ref.watch(extensionControllerProvider).text; bool isModifyExt = ref.watch(modifyExtensionProvider); for (var file in files) { String newExt = file.extension; - if (file.checked && !file.type.isFolder && isModifyExt) newExt = inputExt; + if (!isUndo) { + if (file.checked && !file.type.isFolder && isModifyExt) newExt = inputExt; + } ref.read(fileListProvider.notifier).updateExtension(file.id, newExt); } } @@ -225,7 +227,7 @@ void undo(WidgetRef ref) async { bool isViewMode = ref.watch(viewModeProvider); if (isViewMode) ref.read(refreshImageProvider.notifier).update(); updateName(ref); - updateExtension(ref); + updateExtension(ref, true); NotificationType type = errorList.isNotEmpty ? ErrorNotification(S.current.undoFailed, S.current.undoFailedNum(errorList.length, total), errorList) diff --git a/pubspec.lock b/pubspec.lock index b7f4b8b..d8f9472 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -718,10 +718,10 @@ packages: dependency: "direct main" description: name: package_info_plus - sha256: "894f37107424311bdae3e476552229476777b8752c5a2a2369c0cb9a2d5442ef" + sha256: df3eb3e0aed5c1107bb0fdb80a8e82e778114958b1c5ac5644fb1ac9cae8a998 url: "https://pub.flutter-io.cn" source: hosted - version: "8.0.3" + version: "8.1.0" package_info_plus_platform_interface: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index d7d34e6..cc40533 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -16,7 +16,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 # 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. -version: 2.10.2+0 +version: 2.10.3+0 environment: sdk: '>=3.0.6 <4.0.0' @@ -45,7 +45,7 @@ dependencies: chinese_font_library: ^1.2.0 bot_toast: ^4.1.3 shared_preferences: ^2.3.2 - package_info_plus: ^8.0.3 + package_info_plus: ^8.1.0 url_launcher: ^6.3.1 dio: ^5.7.0 desktop_drop: ^0.5.0 diff --git a/version.json b/version.json index d98f3f4..f3328de 100644 --- a/version.json +++ b/version.json @@ -1,5 +1,10 @@ { "info": [{ + "version": "2.10.3", + "description": [ + "修复了撤销后缀命名操作后界面显示内容未更新的BUG" + ] + },{ "version": "2.10.2", "description": [ "优化了整理文件的用户体验",