mirror of
https://github.com/revoltchat/revite.git
synced 2024-11-25 08:30:58 -05:00
fix: App soft crash when deleting servers (#492)
Co-authored-by: Paul Makles <paulmakles@gmail.com>
This commit is contained in:
parent
8c1f5dfb68
commit
cf55921077
1 changed files with 3 additions and 0 deletions
|
@ -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 a new issue