mirror of
https://github.com/ilyakooo0/urbit.git
synced 2025-01-01 19:46:36 +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 charge = useCharge(desk);
|
||||
const vat = useVat(desk);
|
||||
const otasEnabled = !vat?.arak.rail?.paused;
|
||||
const otaSource = vat?.arak.rail!.ship;
|
||||
const tracking = !!vat?.arak.rail;
|
||||
const otasEnabled = vat?.arak.rail?.paused;
|
||||
const otaSource = vat?.arak.rail?.ship;
|
||||
const toggleOTAs = useKilnState((s) => s.toggleOTAs);
|
||||
|
||||
const toggleUpdates = useCallback((on: boolean) => toggleOTAs(desk, on), [desk, toggleOTAs]);
|
||||
@ -19,14 +20,18 @@ export const AppPrefs = ({ match }: RouteComponentProps<{ desk: string }>) => {
|
||||
<>
|
||||
<h2 className="h3 mb-7">{charge?.title} Settings</h2>
|
||||
<div className="space-y-3">
|
||||
<Setting on={!!otasEnabled} toggle={toggleUpdates} name="Automatic Updates">
|
||||
<p>Automatically download and apply updates to keep {charge?.title} up to date.</p>
|
||||
{otaSource && (
|
||||
<p>
|
||||
OTA Source: <ShipName name={otaSource} className="font-semibold font-mono" />
|
||||
</p>
|
||||
)}
|
||||
</Setting>
|
||||
{tracking ? (
|
||||
<Setting on={!!otasEnabled} toggle={toggleUpdates} name="Automatic Updates">
|
||||
<p>Automatically download and apply updates to keep {charge?.title} up to date.</p>
|
||||
{otaSource && (
|
||||
<p>
|
||||
OTA Source: <ShipName name={otaSource} className="font-semibold font-mono" />
|
||||
</p>
|
||||
)}
|
||||
</Setting>
|
||||
) : (
|
||||
<h4 className="text-gray-500">No settings</h4>
|
||||
)}
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
|
@ -342,13 +342,16 @@ export const mockVat = (desk: string, blockers?: boolean): Vat => ({
|
||||
sub: [],
|
||||
add: []
|
||||
},
|
||||
rail: {
|
||||
aeon: 3,
|
||||
desk,
|
||||
next: blockers ? [{ aeon: 3, weft: { name: 'zuse', kelvin: 419 } }] : [],
|
||||
ship: '~zod',
|
||||
paused: desk === 'groups'
|
||||
}
|
||||
rail:
|
||||
desk === 'uniswap'
|
||||
? null
|
||||
: {
|
||||
aeon: 3,
|
||||
desk,
|
||||
next: blockers ? [{ aeon: 3, weft: { name: 'zuse', kelvin: 419 } }] : [],
|
||||
ship: '~zod',
|
||||
paused: desk === 'groups'
|
||||
}
|
||||
},
|
||||
hash: '0vh.lhfn6.julg1.fs52d.g2lqj.q5kp0.2o7j3.2bljl.jdm34.hd46v.9uv5v'
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user