diff --git a/resources/scripts/components/server/console/PowerButtons.tsx b/resources/scripts/components/server/console/PowerButtons.tsx index b2a789b78..07b10714b 100644 --- a/resources/scripts/components/server/console/PowerButtons.tsx +++ b/resources/scripts/components/server/console/PowerButtons.tsx @@ -1,4 +1,4 @@ -import React, { useState } from 'react'; +import React, { useEffect, useState } from 'react'; import { Button } from '@/components/elements/button/index'; import Can from '@/components/elements/Can'; import { ServerContext } from '@/state/server'; @@ -27,6 +27,12 @@ export default ({ className }: PowerButtonProps) => { } }; + useEffect(() => { + if (status === 'offline') { + setOpen(false); + } + }, [ status ]); + return (