Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LA-1354 removed deleting last version of a file #968

Merged
merged 1 commit into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions lib/presentation/localizations/app_localizations.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3023,6 +3023,14 @@ class AppLocalizations {
name: 'reach_upload_request_limit_message_own_server'
);
}

String get you_cant_delete_the_last_version {
return Intl.message(
"You can't delete the last version, try to delete the whole document",
name: 'you_cant_delete_the_last_version',
);
}

}

class AppLocalizationsDelegate extends LocalizationsDelegate<AppLocalizations> {
Expand Down
4 changes: 4 additions & 0 deletions lib/presentation/util/toast_message_handler.dart
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,10 @@ class ToastMessageHandler {
} else if (failure is CopyToSharedSpaceFailure) {
appToast.showErrorToast(AppLocalizations.of(context).cannot_copy_file_to_shared_space);
_cleanSharedSpaceNodeVersionsViewState();
} else if (failure is RemoveFinalSharedSpaceNodeVersionFailure) {
appToast.showErrorToast(
AppLocalizations.of(context).you_cant_delete_the_last_version);
_cleanSharedSpaceNodeVersionsViewState();
}
},
(success) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ class SharedSpaceNodeVersionsViewModel extends BaseViewModel {
.onConfirmAction(AppLocalizations.of(context).delete, (_) {
_appNavigation.popBack();
if (finalVersion) {
store.dispatch(_removeFinalNodeVersionAction(nodeVersionArguments.workGroupNode));
store.dispatch(SharedSpaceNodeVersionsAction(Left(RemoveFinalSharedSpaceNodeVersionFailure())));
} else {
store.dispatch(_removeNodeVersionAction(document));
}
Expand Down
Loading