1
This commit is contained in:
@@ -92,6 +92,7 @@ class _HomePageState extends State<HomePage> {
|
||||
|
||||
Future<void> _performLogout() async {
|
||||
setState(() => _loggingOut = true);
|
||||
await Future.delayed(const Duration(seconds: 5));
|
||||
try {
|
||||
if (TitleServerConfigHolder().isConfigured && _data != null && _data!.isLogin) {
|
||||
final service = TitleApiService(TitleServerConfigHolder().config!);
|
||||
@@ -114,17 +115,21 @@ class _HomePageState extends State<HomePage> {
|
||||
appBar: AppBar(
|
||||
title: Text(_tabTitles[_currentTab]),
|
||||
actions: [
|
||||
IconButton(
|
||||
icon: _loggingOut
|
||||
? const SizedBox(
|
||||
width: 20,
|
||||
height: 20,
|
||||
child: CircularProgressIndicator(strokeWidth: 2),
|
||||
)
|
||||
: const Icon(Icons.logout),
|
||||
tooltip: AppStrings.logoutTooltip,
|
||||
onPressed: _loggingOut ? null : _performLogout,
|
||||
),
|
||||
if (_loggingOut)
|
||||
const Padding(
|
||||
padding: EdgeInsets.only(right: 12),
|
||||
child: SizedBox(
|
||||
width: 20,
|
||||
height: 20,
|
||||
child: CircularProgressIndicator(strokeWidth: 2),
|
||||
),
|
||||
)
|
||||
else
|
||||
IconButton(
|
||||
icon: const Icon(Icons.logout),
|
||||
tooltip: AppStrings.logoutTooltip,
|
||||
onPressed: _performLogout,
|
||||
),
|
||||
],
|
||||
),
|
||||
body: IndexedStack(
|
||||
|
||||
Reference in New Issue
Block a user