clear mount location if in use
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good

This commit is contained in:
2025-03-22 13:12:32 -05:00
parent 143a41588f
commit e3d036fcb8
5 changed files with 11 additions and 13 deletions

View File

@@ -163,12 +163,15 @@ class Mount with ChangeNotifier {
return true;
}
final badLocation = (!unmount && response.statusCode == 500);
if (badLocation) {
mountConfig.path = "";
}
await refresh(force: true);
_isMounting = false;
if (!unmount && response.statusCode == 500) {
return false;
}
return !badLocation;
} catch (e) {
debugPrint('$e');
}

View File

@@ -4,7 +4,7 @@ import 'package:repertory/helpers.dart' show initialCaps;
class MountConfig {
bool? mounted;
final String _name;
String _path = '';
String path = '';
Map<String, dynamic> _settings = {};
final String _type;
MountConfig({required name, required type, Map<String, dynamic>? settings})
@@ -17,7 +17,6 @@ class MountConfig {
String? get bucket => _settings['${provider}Config']?["Bucket"] as String;
String get name => _name;
String get path => _path;
String get provider => initialCaps(_type);
UnmodifiableMapView<String, dynamic> get settings =>
UnmodifiableMapView<String, dynamic>(_settings);
@@ -28,7 +27,7 @@ class MountConfig {
}
void updateStatus(Map<String, dynamic> status) {
_path = status['Location'] as String;
path = status['Location'] as String;
mounted = status['Active'] as bool;
}
}