Skip to content

A cross platform Audiobookshelf client for Android and iOS

Dart

Put the Server Admin button in the desktop side panel for BookOrbit admins too and take the admin cards out of Settings there

Barnabas2e5b59b8d4ce
diff --git a/lib/screens/app_shell.dart b/lib/screens/app_shell.dart
index 89b358a8..423b29b6 100644
--- a/lib/screens/app_shell.dart
+++ b/lib/screens/app_shell.dart
@@ -1277,6 +1277,11 @@ class _AppShellState extends State<AppShell>
);
}
+ // BookOrbit admins get their own pages; Audiobookshelf admins the
+ // server admin screen.
+ final showAdmin = auth.isBookOrbit
+ ? auth.bookOrbitAdmin?.any == true
+ : auth.isAdmin;
void openAdmin() {
if (_adminRouteOpen) return;
final navigator = _paneNavigatorKey.currentState;
@@ -1284,7 +1289,9 @@ class _AppShellState extends State<AppShell>
_adminRouteOpen = true;
unawaited(navigator
.push(MaterialPageRoute<void>(
- builder: (_) => AdminScreen(taskTracker: _serverTaskTracker),
+ builder: (_) => auth.isBookOrbit
+ ? const BookOrbitAdminScreen()
+ : AdminScreen(taskTracker: _serverTaskTracker),
))
.whenComplete(() => _adminRouteOpen = false));
}
@@ -1428,7 +1435,7 @@ class _AppShellState extends State<AppShell>
],
),
),
- if (auth.isAdmin)
+ if (showAdmin)
Padding(
padding: const EdgeInsets.symmetric(horizontal: 12),
child: extended
diff --git a/lib/screens/settings_screen.dart b/lib/screens/settings_screen.dart
index 59354242..1fbe6b6f 100644
--- a/lib/screens/settings_screen.dart
+++ b/lib/screens/settings_screen.dart
@@ -2157,7 +2157,8 @@ class SettingsScreenState extends State<SettingsScreen> {
),
// ── Admin Controls ──
- if (auth.isAdmin)
+ // The desktop sidebar carries the admin button instead.
+ if (auth.isAdmin && !isDesktopWorkspace(context))
Padding(
padding: const EdgeInsets.fromLTRB(16, 16, 16, 0),
child: Material(
@@ -2204,7 +2205,7 @@ class SettingsScreenState extends State<SettingsScreen> {
),
),
- if (auth.bookOrbitAdmin?.any == true)
+ if (auth.bookOrbitAdmin?.any == true && !isDesktopWorkspace(context))
Padding(
padding: const EdgeInsets.fromLTRB(16, 16, 16, 0),
child: Material(