Skip to content

Commit

Permalink
:Bug: Fixed the bug where the interface display content was not updat…
Browse files Browse the repository at this point in the history
…ed after revoking the suffix naming operation
  • Loading branch information
ilgnefz committed Oct 20, 2024
1 parent e101617 commit cde31bc
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
8 changes: 5 additions & 3 deletions lib/core/rename.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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<FileInfo> 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);
}
}
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions version.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"info": [{
"version": "2.10.3",
"description": [
"修复了撤销后缀命名操作后界面显示内容未更新的BUG"
]
},{
"version": "2.10.2",
"description": [
"优化了整理文件的用户体验",
Expand Down

0 comments on commit cde31bc

Please sign in to comment.