1
1
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:
DaneEveritt 2022-06-25 21:29:41 -04:00
parent 76f3b996fe
commit 00338e431b
No known key found for this signature in database
GPG Key ID: EEA66103B3D71F53

View File

@ -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