fix: App soft crash when deleting servers (#492)
Co-authored-by: Paul Makles <paulmakles@gmail.com>pull/498/head
parent
8c1f5dfb68
commit
cf55921077
|
|
@ -81,6 +81,7 @@ type SpecialProps = { onClose: () => void } & (
|
|||
|
||||
export const SpecialPromptModal = observer((props: SpecialProps) => {
|
||||
const client = useContext(AppContext);
|
||||
const history = useHistory();
|
||||
const [processing, setProcessing] = useState(false);
|
||||
const [error, setError] = useState<undefined | string>(undefined);
|
||||
|
||||
|
|
@ -157,6 +158,8 @@ export const SpecialPromptModal = observer((props: SpecialProps) => {
|
|||
case "delete_channel":
|
||||
case "leave_server":
|
||||
case "delete_server":
|
||||
if (props.type != "delete_channel")
|
||||
history.push("/");
|
||||
props.target.delete();
|
||||
break;
|
||||
case "delete_bot":
|
||||
|
|
|
|||
Loading…
Reference in New Issue