Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,16 @@ export function SettingsEnvironmentsRouteScreen() {
const handleToggle = useCallback((environmentId: EnvironmentId) => {
setExpandedId((prev) => (prev === environmentId ? null : environmentId));
}, []);
// Retries every environment at once. This is not a placebo refresh: the
// underlying command is `retryNow`, which short-circuits the reconnect
// backoff, so it is the one way to escape a long backoff delay without
// waiting it out.
const handleRefreshAll = useCallback(() => {
for (const environment of connectedEnvironments) {
onReconnectEnvironment(environment.environmentId);
}
}, [connectedEnvironments, onReconnectEnvironment]);
const canRefreshAll = connectedEnvironments.length > 0;
const handleUpdateEnvironment = useCallback(
(
environmentId: EnvironmentId,
Expand Down Expand Up @@ -94,7 +104,15 @@ export function SettingsEnvironmentsRouteScreen() {
<AndroidScreenHeader
title="Environments"
onBack={() => navigation.goBack()}
// Rendered in array order, left to right — the reverse of the iOS
// toolbar below. Same result on screen: (refresh, add).
actions={[
{
accessibilityLabel: "Refresh all environments",
disabled: !canRefreshAll,
icon: "arrow.clockwise",
onPress: handleRefreshAll,
},
{
accessibilityLabel: "Add environment",
icon: "plus",
Expand All @@ -105,6 +123,9 @@ export function SettingsEnvironmentsRouteScreen() {
/>
</>
) : (
// UIKit orders right-side bar items from the right edge inward, so
// this reads right-to-left on screen: add stays outermost, refresh
// sits inside it. Visually: (refresh, add).
<NativeHeaderToolbar placement="right">
<NativeHeaderToolbar.Button
icon="plus"
Expand All @@ -114,6 +135,14 @@ export function SettingsEnvironmentsRouteScreen() {
separateBackground
tintColor={headerIconColor}
/>
<NativeHeaderToolbar.Button
accessibilityLabel="Refresh all environments"
disabled={!canRefreshAll}
icon="arrow.clockwise"
onPress={handleRefreshAll}
separateBackground
tintColor={headerIconColor}
/>
</NativeHeaderToolbar>
)}
<ScrollView
Expand Down
Loading