Skip to content
This repository was archived by the owner on Dec 18, 2023. It is now read-only.

Commit 230ab9a

Browse files
committed
Removed some useless GH calls
1 parent 4cd76c3 commit 230ab9a

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

frontend/src/panels/admin.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ function Sessions({ client, conf, user }: { client: Client, conf: Configuration,
378378
{errorMessage &&
379379
<ErrorSnackbar open={true} message={errorMessage} onClose={() => setErrorMessage(null)} />}
380380
<SessionCreationDialog allowUserSelection={true} client={client} conf={conf} sessions={resources} user={user} users={users} templates={templates} show={showCreationDialog} onCreate={(conf, id) => onCreate(conf, id, setSessions)} onHide={() => setShowCreationDialog(false)} />
381-
{selected &&
381+
{(selected && showUpdateDialog) &&
382382
<SessionUpdateDialog id={selected} duration={resources[selected].duration} show={showUpdateDialog} onUpdate={(id, conf) => onUpdate(id, conf, setSessions)} onHide={() => setShowUpdateDialog(false)} />}
383383
</>
384384
)}
@@ -793,8 +793,9 @@ function Users({ client, user, conf }: { client: Client, user: LoggedUser, conf:
793793
</TableContainer>
794794
{errorMessage &&
795795
<ErrorSnackbar open={true} message={errorMessage} onClose={() => setErrorMessage(null)} />}
796-
<UserCreationDialog client={client} conf={conf} users={resources} show={showCreationDialog} onCreate={(id, conf) => onCreate(id, conf, setUsers)} onHide={() => setShowCreationDialog(false)} />
797-
{selected &&
796+
{showCreationDialog &&
797+
<UserCreationDialog client={client} conf={conf} users={resources} show={showCreationDialog} onCreate={(id, conf) => onCreate(id, conf, setUsers)} onHide={() => setShowCreationDialog(false)} />}
798+
{(selected && showUpdateDialog) &&
798799
<UserUpdateDialog client={client} id={selected} user={resources[selected]} show={showUpdateDialog} onUpdate={(id, conf) => onUpdate(id, conf, setUsers)} onHide={() => setShowUpdateDialog(false)} />}
799800
</>
800801
)}

frontend/src/panels/session.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,8 @@ function TemplateSelector({client, conf, user, templates, onDeployed, onRetry}:
169169
</Container>
170170
{errorMessage &&
171171
<ErrorSnackbar open={true} message={errorMessage} onClose={() => setErrorMessage(null)} />}
172-
<SessionCreationDialog client={client} user={user} template={selection[0]} conf={conf} templates={templates} show={openCustom} onCreate={onCreateClick} onHide={() => setOpenCustom(false)} />
172+
{openCustom &&
173+
<SessionCreationDialog client={client} user={user} template={selection[0]} conf={conf} templates={templates} show={openCustom} onCreate={onCreateClick} onHide={() => setOpenCustom(false)} />}
173174
</>
174175
);
175176
} else {

0 commit comments

Comments
 (0)