Automatically hide the kill modal when server stops
This commit is contained in:
parent
76f3b996fe
commit
00338e431b
1 changed files with 7 additions and 1 deletions
|
@ -1,4 +1,4 @@
|
||||||
import React, { useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import { Button } from '@/components/elements/button/index';
|
import { Button } from '@/components/elements/button/index';
|
||||||
import Can from '@/components/elements/Can';
|
import Can from '@/components/elements/Can';
|
||||||
import { ServerContext } from '@/state/server';
|
import { ServerContext } from '@/state/server';
|
||||||
|
@ -27,6 +27,12 @@ export default ({ className }: PowerButtonProps) => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (status === 'offline') {
|
||||||
|
setOpen(false);
|
||||||
|
}
|
||||||
|
}, [ status ]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={className}>
|
<div className={className}>
|
||||||
<Dialog.Confirm
|
<Dialog.Confirm
|
||||||
|
|
Loading…
Reference in a new issue