Skip to content

Commit

Permalink
fix: show describe data on first load
Browse files Browse the repository at this point in the history
  • Loading branch information
laszlocph committed Mar 14, 2024
1 parent 89ee250 commit 8d1f770
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions web/dashboard/src/views/footer/capacitor/Describe.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ export function Describe(props) {
const { capacitorClient, store, namespace, deployment, pods } = props;
const [showModal, setShowModal] = useState(false)
const [selected, setSelected] = useState(namespace + "/" + deployment)
const [details, setDetails] = useState(store.getState().details);
store.subscribe(() => setDetails(store.getState().details));
const [content, setContent] = useState()
store.subscribe(() => setContent(store.getState().details[selected]));

const describeDeployment = () => {
capacitorClient.deploymentDetailsRequest(namespace, deployment)
Expand Down Expand Up @@ -58,8 +58,8 @@ export function Describe(props) {
describePod={describePod}
/>}
>
<code className='flex whitespace-pre items-center font-mono text-xs p-2 text-yellow-100 rounded'>
{details[selected] ?? <SkeletonLoader />}
<code key={selected} className='flex whitespace-pre items-center font-mono text-xs p-2 text-yellow-100 rounded'>
{content ?? <SkeletonLoader />}
</code>
</Modal>
}
Expand Down

0 comments on commit 8d1f770

Please sign in to comment.