mirror of
https://github.com/urbit/shrub.git
synced 2024-12-22 10:21:31 +03:00
grid: fix settings rendering if no upstream
This commit is contained in:
parent
ba353fbd36
commit
2592ef673b
@ -9,8 +9,9 @@ export const AppPrefs = ({ match }: RouteComponentProps<{ desk: string }>) => {
|
|||||||
const { desk } = match.params;
|
const { desk } = match.params;
|
||||||
const charge = useCharge(desk);
|
const charge = useCharge(desk);
|
||||||
const vat = useVat(desk);
|
const vat = useVat(desk);
|
||||||
const otasEnabled = !vat?.arak.rail?.paused;
|
const tracking = !!vat?.arak.rail;
|
||||||
const otaSource = vat?.arak.rail!.ship;
|
const otasEnabled = vat?.arak.rail?.paused;
|
||||||
|
const otaSource = vat?.arak.rail?.ship;
|
||||||
const toggleOTAs = useKilnState((s) => s.toggleOTAs);
|
const toggleOTAs = useKilnState((s) => s.toggleOTAs);
|
||||||
|
|
||||||
const toggleUpdates = useCallback((on: boolean) => toggleOTAs(desk, on), [desk, toggleOTAs]);
|
const toggleUpdates = useCallback((on: boolean) => toggleOTAs(desk, on), [desk, toggleOTAs]);
|
||||||
@ -19,6 +20,7 @@ export const AppPrefs = ({ match }: RouteComponentProps<{ desk: string }>) => {
|
|||||||
<>
|
<>
|
||||||
<h2 className="h3 mb-7">{charge?.title} Settings</h2>
|
<h2 className="h3 mb-7">{charge?.title} Settings</h2>
|
||||||
<div className="space-y-3">
|
<div className="space-y-3">
|
||||||
|
{tracking ? (
|
||||||
<Setting on={!!otasEnabled} toggle={toggleUpdates} name="Automatic Updates">
|
<Setting on={!!otasEnabled} toggle={toggleUpdates} name="Automatic Updates">
|
||||||
<p>Automatically download and apply updates to keep {charge?.title} up to date.</p>
|
<p>Automatically download and apply updates to keep {charge?.title} up to date.</p>
|
||||||
{otaSource && (
|
{otaSource && (
|
||||||
@ -27,6 +29,9 @@ export const AppPrefs = ({ match }: RouteComponentProps<{ desk: string }>) => {
|
|||||||
</p>
|
</p>
|
||||||
)}
|
)}
|
||||||
</Setting>
|
</Setting>
|
||||||
|
) : (
|
||||||
|
<h4 className="text-gray-500">No settings</h4>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
@ -342,7 +342,10 @@ export const mockVat = (desk: string, blockers?: boolean): Vat => ({
|
|||||||
sub: [],
|
sub: [],
|
||||||
add: []
|
add: []
|
||||||
},
|
},
|
||||||
rail: {
|
rail:
|
||||||
|
desk === 'uniswap'
|
||||||
|
? null
|
||||||
|
: {
|
||||||
aeon: 3,
|
aeon: 3,
|
||||||
desk,
|
desk,
|
||||||
next: blockers ? [{ aeon: 3, weft: { name: 'zuse', kelvin: 419 } }] : [],
|
next: blockers ? [{ aeon: 3, weft: { name: 'zuse', kelvin: 419 } }] : [],
|
||||||
|
Loading…
Reference in New Issue
Block a user