Поправил типы
This commit is contained in:
parent
5f59bbe18f
commit
931042e716
@ -281,16 +281,16 @@ export default function Processes() {
|
|||||||
</IconButton>}
|
</IconButton>}
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell>
|
<TableCell>
|
||||||
{process.canUnlock && token?.permissions.indexOf('unlock_process') > -1 && <IconButton onClick={() => openDialog(process, Action.Unlock)} title={`Unlock`} aria-label="Unlock">
|
{process.canUnlock && token && token?.permissions.indexOf('unlock_process') > -1 && <IconButton onClick={() => openDialog(process, Action.Unlock)} title={`Unlock`} aria-label="Unlock">
|
||||||
<LockOpenOutlined/>
|
<LockOpenOutlined/>
|
||||||
</IconButton>}
|
</IconButton>}
|
||||||
{process.canApprove && token?.permissions.indexOf('approve_process') > -1 && <IconButton onClick={() => openDialog(process, Action.Approve)} title={`Approve`} aria-label="Approve">
|
{process.canApprove && token && token?.permissions.indexOf('approve_process') > -1 && <IconButton onClick={() => openDialog(process, Action.Approve)} title={`Approve`} aria-label="Approve">
|
||||||
<ThumbUpAltOutlined/>
|
<ThumbUpAltOutlined/>
|
||||||
</IconButton>}
|
</IconButton>}
|
||||||
{process.canRepeat && token?.permissions.indexOf('run_command') > -1 && <IconButton onClick={() => openDialog(process, Action.Repeat)} title={`Repeat`} aria-label="Repeat">
|
{process.canRepeat && token && token?.permissions.indexOf('run_command') > -1 && <IconButton onClick={() => openDialog(process, Action.Repeat)} title={`Repeat`} aria-label="Repeat">
|
||||||
<ReplayOutlined/>
|
<ReplayOutlined/>
|
||||||
</IconButton>}
|
</IconButton>}
|
||||||
{process.canKill && token?.permissions.indexOf('kill_process') > -1 && <IconButton onClick={() => openDialog(process, Action.Kill)} title={`Kill`} aria-label="Kill">
|
{process.canKill && token && token?.permissions.indexOf('kill_process') > -1 && <IconButton onClick={() => openDialog(process, Action.Kill)} title={`Kill`} aria-label="Kill">
|
||||||
<DeleteForeverOutlined/>
|
<DeleteForeverOutlined/>
|
||||||
</IconButton>}
|
</IconButton>}
|
||||||
{process?.outputId && <IconButton title={`Output`} onClick={() => output(process)} aria-label="Output">
|
{process?.outputId && <IconButton title={`Output`} onClick={() => output(process)} aria-label="Output">
|
||||||
|
@ -12,7 +12,7 @@ export interface UseTokenInterface {
|
|||||||
tokens: Token[]
|
tokens: Token[]
|
||||||
switchToken(tokenId: string): void
|
switchToken(tokenId: string): void
|
||||||
deleteToken(tokenId: string): void
|
deleteToken(tokenId: string): void
|
||||||
addToken(tokenId: string): void
|
addToken(tokenId: string): boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
export function useToken(): UseTokenInterface {
|
export function useToken(): UseTokenInterface {
|
||||||
@ -21,7 +21,7 @@ export function useToken(): UseTokenInterface {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setToken(grabToken()?.payload)
|
setToken(grabToken()?.payload)
|
||||||
|
|
||||||
let tokens = grabTokens().map((tokenData) => tokenData.payload)
|
let tokens = grabTokens().map((tokenData) => tokenData.payload as Token)
|
||||||
setTokens(tokens)
|
setTokens(tokens)
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
|
Loading…
Reference in New Issue
Block a user