add manual full cloud index refresh
This commit is contained in:
@@ -75,6 +75,7 @@ class _SettingsDialogState extends ConsumerState<SettingsDialog> {
|
||||
Widget build(BuildContext context) {
|
||||
final cs = ShadTheme.of(context).colorScheme;
|
||||
final themeState = ref.watch(themeProvider);
|
||||
final mediaState = ref.watch(mediaLibraryProvider);
|
||||
|
||||
return ShadDialog(
|
||||
title: const Text('设置'),
|
||||
@@ -235,6 +236,31 @@ class _SettingsDialogState extends ConsumerState<SettingsDialog> {
|
||||
),
|
||||
),
|
||||
),
|
||||
_SettingsRow(
|
||||
icon: Icons.refresh_rounded,
|
||||
label: '全盘文件索引',
|
||||
child: ShadButton.outline(
|
||||
size: ShadButtonSize.sm,
|
||||
onPressed: mediaState.isRefreshingCloudIndex
|
||||
? null
|
||||
: () => ref
|
||||
.read(mediaLibraryProvider.notifier)
|
||||
.refreshGlobalCloudIndex(force: true),
|
||||
leading: mediaState.isRefreshingCloudIndex
|
||||
? SizedBox(
|
||||
width: 14,
|
||||
height: 14,
|
||||
child: CircularProgressIndicator(
|
||||
strokeWidth: 2,
|
||||
color: cs.primary,
|
||||
),
|
||||
)
|
||||
: const Icon(Icons.refresh_rounded, size: 15),
|
||||
child: Text(
|
||||
mediaState.isRefreshingCloudIndex ? '刷新中' : '立即刷新',
|
||||
),
|
||||
),
|
||||
),
|
||||
_SettingsRow(
|
||||
icon: Icons.format_list_numbered_rounded,
|
||||
label: '默认分页大小',
|
||||
|
||||
Reference in New Issue
Block a user