only pass values
This commit is contained in:
+5
-5
@@ -112,7 +112,7 @@ class ClearSiteDataSection extends HookConsumerWidget {
|
|||||||
context,
|
context,
|
||||||
ref,
|
ref,
|
||||||
isClearing,
|
isClearing,
|
||||||
selectedTypes,
|
selectedTypes.value,
|
||||||
),
|
),
|
||||||
icon: isClearing.value
|
icon: isClearing.value
|
||||||
? const SizedBox(
|
? const SizedBox(
|
||||||
@@ -134,9 +134,9 @@ class ClearSiteDataSection extends HookConsumerWidget {
|
|||||||
BuildContext context,
|
BuildContext context,
|
||||||
WidgetRef ref,
|
WidgetRef ref,
|
||||||
ValueNotifier<bool> isClearing,
|
ValueNotifier<bool> isClearing,
|
||||||
ValueNotifier<Set<ClearDataType>> selectedTypes,
|
Set<ClearDataType> selectedTypes,
|
||||||
) async {
|
) async {
|
||||||
if (selectedTypes.value.isEmpty) {
|
if (selectedTypes.isEmpty) {
|
||||||
showErrorMessage(context, 'Select at least one data type');
|
showErrorMessage(context, 'Select at least one data type');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -144,13 +144,13 @@ class ClearSiteDataSection extends HookConsumerWidget {
|
|||||||
final confirmed = await showClearSiteDataDialog(
|
final confirmed = await showClearSiteDataDialog(
|
||||||
context,
|
context,
|
||||||
host: url.host,
|
host: url.host,
|
||||||
formattedTypes: _formatTypes(selectedTypes.value),
|
formattedTypes: _formatTypes(selectedTypes),
|
||||||
);
|
);
|
||||||
|
|
||||||
if (confirmed == true && context.mounted) {
|
if (confirmed == true && context.mounted) {
|
||||||
isClearing.value = true;
|
isClearing.value = true;
|
||||||
try {
|
try {
|
||||||
await _clearData(ref, selectedTypes.value);
|
await _clearData(ref, selectedTypes);
|
||||||
if (context.mounted) {
|
if (context.mounted) {
|
||||||
showInfoMessage(context, 'Site data cleared');
|
showInfoMessage(context, 'Site data cleared');
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user