mirror of
https://github.com/urbit/shrub.git
synced 2024-12-22 02:11:38 +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,6 +20,7 @@ export const AppPrefs = ({ match }: RouteComponentProps<{ desk: string }>) => {
|
||||
<>
|
||||
<h2 className="h3 mb-7">{charge?.title} Settings</h2>
|
||||
<div className="space-y-3">
|
||||
{tracking ? (
|
||||
<Setting on={!!otasEnabled} toggle={toggleUpdates} name="Automatic Updates">
|
||||
<p>Automatically download and apply updates to keep {charge?.title} up to date.</p>
|
||||
{otaSource && (
|
||||
@ -27,6 +29,9 @@ export const AppPrefs = ({ match }: RouteComponentProps<{ desk: string }>) => {
|
||||
</p>
|
||||
)}
|
||||
</Setting>
|
||||
) : (
|
||||
<h4 className="text-gray-500">No settings</h4>
|
||||
)}
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
|
@ -342,7 +342,10 @@ export const mockVat = (desk: string, blockers?: boolean): Vat => ({
|
||||
sub: [],
|
||||
add: []
|
||||
},
|
||||
rail: {
|
||||
rail:
|
||||
desk === 'uniswap'
|
||||
? null
|
||||
: {
|
||||
aeon: 3,
|
||||
desk,
|
||||
next: blockers ? [{ aeon: 3, weft: { name: 'zuse', kelvin: 419 } }] : [],
|
||||
|
Loading…
Reference in New Issue
Block a user