Skip to content

Commit cde31bc

Browse files
committed
:Bug: Fixed the bug where the interface display content was not updated after revoking the suffix naming operation
1 parent e101617 commit cde31bc

File tree

4 files changed

+14
-7
lines changed

4 files changed

+14
-7
lines changed

lib/core/rename.dart

+5-3
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,15 @@ import 'package:once_power/widgets/common/notification.dart';
1818
import 'package:path/path.dart' as path;
1919
import 'package:path_provider/path_provider.dart';
2020

21-
void updateExtension(WidgetRef ref) {
21+
void updateExtension(WidgetRef ref, [bool isUndo = false]) {
2222
List<FileInfo> files = ref.read(fileListProvider);
2323
String inputExt = ref.watch(extensionControllerProvider).text;
2424
bool isModifyExt = ref.watch(modifyExtensionProvider);
2525
for (var file in files) {
2626
String newExt = file.extension;
27-
if (file.checked && !file.type.isFolder && isModifyExt) newExt = inputExt;
27+
if (!isUndo) {
28+
if (file.checked && !file.type.isFolder && isModifyExt) newExt = inputExt;
29+
}
2830
ref.read(fileListProvider.notifier).updateExtension(file.id, newExt);
2931
}
3032
}
@@ -225,7 +227,7 @@ void undo(WidgetRef ref) async {
225227
bool isViewMode = ref.watch(viewModeProvider);
226228
if (isViewMode) ref.read(refreshImageProvider.notifier).update();
227229
updateName(ref);
228-
updateExtension(ref);
230+
updateExtension(ref, true);
229231
NotificationType type = errorList.isNotEmpty
230232
? ErrorNotification(S.current.undoFailed,
231233
S.current.undoFailedNum(errorList.length, total), errorList)

pubspec.lock

+2-2
Original file line numberDiff line numberDiff line change
@@ -718,10 +718,10 @@ packages:
718718
dependency: "direct main"
719719
description:
720720
name: package_info_plus
721-
sha256: "894f37107424311bdae3e476552229476777b8752c5a2a2369c0cb9a2d5442ef"
721+
sha256: df3eb3e0aed5c1107bb0fdb80a8e82e778114958b1c5ac5644fb1ac9cae8a998
722722
url: "https://pub.flutter-io.cn"
723723
source: hosted
724-
version: "8.0.3"
724+
version: "8.1.0"
725725
package_info_plus_platform_interface:
726726
dependency: transitive
727727
description:

pubspec.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
1616
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
1717
# In Windows, build-name is used as the major, minor, and patch parts
1818
# of the product and file versions while build-number is used as the build suffix.
19-
version: 2.10.2+0
19+
version: 2.10.3+0
2020

2121
environment:
2222
sdk: '>=3.0.6 <4.0.0'
@@ -45,7 +45,7 @@ dependencies:
4545
chinese_font_library: ^1.2.0
4646
bot_toast: ^4.1.3
4747
shared_preferences: ^2.3.2
48-
package_info_plus: ^8.0.3
48+
package_info_plus: ^8.1.0
4949
url_launcher: ^6.3.1
5050
dio: ^5.7.0
5151
desktop_drop: ^0.5.0

version.json

+5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
{
22
"info": [{
3+
"version": "2.10.3",
4+
"description": [
5+
"修复了撤销后缀命名操作后界面显示内容未更新的BUG"
6+
]
7+
},{
38
"version": "2.10.2",
49
"description": [
510
"优化了整理文件的用户体验",

0 commit comments

Comments
 (0)