mirror of
https://github.com/tloncorp/landscape.git
synced 2024-12-29 11:42:41 +03:00
App installs: fix missing treaty info on install
This commit is contained in:
parent
8232b8f00b
commit
6c80025e6f
@ -18,6 +18,7 @@ type App = ChargeWithDesk | Treaty;
|
||||
interface AppInfoProps {
|
||||
docket: App;
|
||||
pike?: Pike;
|
||||
treatyInfoShip?: string;
|
||||
className?: string;
|
||||
}
|
||||
|
||||
@ -34,20 +35,25 @@ function getInstallStatus(docket: App): InstallStatus {
|
||||
return 'uninstalled';
|
||||
}
|
||||
|
||||
function getRemoteDesk(docket: App, pike?: Pike) {
|
||||
function getRemoteDesk(docket: App, pike?: Pike, treatyInfoShip?: string) {
|
||||
if (pike && pike.sync) {
|
||||
return [pike.sync.ship, pike.sync.desk];
|
||||
}
|
||||
if ('chad' in docket) {
|
||||
return ['', docket.desk];
|
||||
return [treatyInfoShip ?? '', docket.desk];
|
||||
}
|
||||
const { ship, desk } = docket;
|
||||
return [ship, desk];
|
||||
}
|
||||
|
||||
export const AppInfo: FC<AppInfoProps> = ({ docket, pike, className }) => {
|
||||
export const AppInfo: FC<AppInfoProps> = ({
|
||||
docket,
|
||||
pike,
|
||||
className,
|
||||
treatyInfoShip,
|
||||
}) => {
|
||||
const installStatus = getInstallStatus(docket);
|
||||
const [ship, desk] = getRemoteDesk(docket, pike);
|
||||
const [ship, desk] = getRemoteDesk(docket, pike, treatyInfoShip);
|
||||
const publisher = pike?.sync?.ship ?? ship;
|
||||
const [copied, setCopied] = useState(false);
|
||||
const treaty = useTreaty(ship, desk);
|
||||
|
@ -30,9 +30,16 @@ export const TreatyInfo = () => {
|
||||
// TODO: maybe replace spinner with skeletons
|
||||
return (
|
||||
<div className="dialog-inner-container flex justify-center text-black">
|
||||
<Spinner className="w-10 h-10" />
|
||||
<Spinner className="h-10 w-10" />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
return <AppInfo className="dialog-inner-container" docket={charge || treaty} pike={pike} />;
|
||||
return (
|
||||
<AppInfo
|
||||
treatyInfoShip={treaty.ship}
|
||||
className="dialog-inner-container"
|
||||
docket={charge || treaty}
|
||||
pike={pike}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user