fixes
This commit is contained in:
parent
d209b52848
commit
1a7dc51c4b
@ -16,7 +16,7 @@ class MountList with ChangeNotifier {
|
||||
UnmodifiableListView<MountConfig> get items =>
|
||||
UnmodifiableListView<MountConfig>(_mountList);
|
||||
|
||||
bool hasBucketName(String mountType, String name, {String? excludeName}) {
|
||||
bool hasBucketName(String mountType, String bucket, {String? excludeName}) {
|
||||
return (excludeName == null
|
||||
? items
|
||||
: items.whereNot(
|
||||
@ -25,9 +25,9 @@ class MountList with ChangeNotifier {
|
||||
))
|
||||
.firstWhereOrNull(
|
||||
(item) =>
|
||||
(item.settings["${mountType}Config"]["Bucket"] as String)
|
||||
.toLowerCase() ==
|
||||
name.toLowerCase(),
|
||||
item.type.toLowerCase() == mountType.toLowerCase() &&
|
||||
item.bucket != null &&
|
||||
item.bucket!.toLowerCase() == bucket.toLowerCase(),
|
||||
) !=
|
||||
null;
|
||||
}
|
||||
|
@ -158,7 +158,7 @@ class _AddMountScreenState extends State<AddMountScreen> {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(
|
||||
"Configuration '${_mountNameController.text}' already exists",
|
||||
"Configuration name '${_mountNameController.text}' already exists",
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
|
@ -1,5 +1,6 @@
|
||||
import 'package:collection/collection.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:repertory/helpers.dart' show initialCaps;
|
||||
|
||||
class MountConfig {
|
||||
final String _name;
|
||||
@ -15,6 +16,8 @@ class MountConfig {
|
||||
}
|
||||
}
|
||||
|
||||
String? get bucket =>
|
||||
_settings['${initialCaps(_type)}Config']?["Bucket"] as String;
|
||||
String get name => _name;
|
||||
String get path => _path;
|
||||
UnmodifiableMapView<String, dynamic> get settings =>
|
||||
|
Loading…
x
Reference in New Issue
Block a user