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