mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
Fixed: Prevent delete of last profile
This commit is contained in:
@@ -5,13 +5,14 @@ import createAllIndexersSelector from './createAllIndexersSelector';
|
||||
function createProfileInUseSelector(profileProp) {
|
||||
return createSelector(
|
||||
(state, { id }) => id,
|
||||
(state) => state.settings.appProfiles.items,
|
||||
createAllIndexersSelector(),
|
||||
(id, indexers) => {
|
||||
(id, profiles, indexers) => {
|
||||
if (!id) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (_.some(indexers, { [profileProp]: id })) {
|
||||
if (_.some(indexers, { [profileProp]: id }) || profiles.length <= 1) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user