We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 76f3b99 commit 00338e4Copy full SHA for 00338e4
resources/scripts/components/server/console/PowerButtons.tsx
@@ -1,4 +1,4 @@
1
-import React, { useState } from 'react';
+import React, { useEffect, useState } from 'react';
2
import { Button } from '@/components/elements/button/index';
3
import Can from '@/components/elements/Can';
4
import { ServerContext } from '@/state/server';
@@ -27,6 +27,12 @@ export default ({ className }: PowerButtonProps) => {
27
}
28
};
29
30
+ useEffect(() => {
31
+ if (status === 'offline') {
32
+ setOpen(false);
33
+ }
34
+ }, [ status ]);
35
+
36
return (
37
<div className={className}>
38
<Dialog.Confirm
0 commit comments