Add react-modal, replace confirm usage with it

This commit is contained in:
Ken-Håvard Lieng 2019-01-05 07:08:34 +01:00
parent 63cf65100d
commit 0085cea5a1
17 changed files with 443 additions and 152 deletions

View file

@ -7,6 +7,7 @@ import {
addMessage,
addMessages
} from 'state/messages';
import { openModal } from 'state/modals';
import { reconnect } from 'state/servers';
import { select } from 'state/tab';
import { find, normalizeChannel } from 'utils';
@ -123,15 +124,17 @@ export default function handleSocket({
},
connection_update({ server, errorType }) {
if (
errorType === 'verify' &&
window.confirm(
'The server is using a self-signed certificate, continue anyway?'
)
) {
if (errorType === 'verify') {
dispatch(
reconnect(server, {
skipVerify: true
openModal('confirm', {
question:
'The server is using a self-signed certificate, continue anyway?',
onConfirm: () =>
dispatch(
reconnect(server, {
skipVerify: true
})
)
})
);
}