mirror of
https://github.com/pterodactyl/panel.git
synced 2024-11-25 10:32:31 +01:00
Automatically hide the kill modal when server stops
This commit is contained in:
parent
76f3b996fe
commit
00338e431b
@ -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 (
|
||||
<div className={className}>
|
||||
<Dialog.Confirm
|
||||
|
Loading…
Reference in New Issue
Block a user