diff --git a/resources/wireguard/windows/wg0.conf b/resources/wireguard/windows/wg0.conf index f5bffdd..e47a3c7 100644 --- a/resources/wireguard/windows/wg0.conf +++ b/resources/wireguard/windows/wg0.conf @@ -1,7 +1,7 @@ [Interface] -PrivateKey = GKXyqCZfS9r2yWzqHJ43L24dnW13VJNilER9jwkyREE= -Address = 10.0.0.95/32 +PrivateKey = OPasvZsdAdU46BJLXOLMqy4BgZq/UvKtjTRpTTVSGX8= +Address = 10.0.0.96/32 DNS = 1.1.1.1 [Peer] diff --git a/src/electron/api/axiosClient.ts b/src/electron/api/axiosClient.ts index bb23df0..3cd6426 100644 --- a/src/electron/api/axiosClient.ts +++ b/src/electron/api/axiosClient.ts @@ -18,7 +18,7 @@ const httpsAgent = new https.Agent({ console.log('Base_URL$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$' ,Base_URL) const api: AxiosInstance = axios.create({ - // baseURL: 'https://quality-friendly-goldfish.ngrok-free.app/api/v1/va', // 🔁 your backend + // baseURL: 'https://portal-sf.docva.com/api/v1/va', // 🔁 your backend baseURL: `${Base_URL}/api/v1/va`, httpsAgent // timeout: 10000, diff --git a/src/electron/api/baseURL.ts b/src/electron/api/baseURL.ts index 67478cd..2a33d5a 100644 --- a/src/electron/api/baseURL.ts +++ b/src/electron/api/baseURL.ts @@ -1,5 +1,5 @@ -// let CURRENT_BASE_URL = "https://quality-friendly-goldfish.ngrok-free.app/api/v1/va"; -let CURRENT_BASE_URL = "https://quality-friendly-goldfish.ngrok-free.app"; +// let CURRENT_BASE_URL = "https://portal-sf.docva.com/api/v1/va"; +let CURRENT_BASE_URL = "https://portal-sf.docva.com"; export const getBaseURL = () => CURRENT_BASE_URL; export const setBaseURL = (url: string) => { diff --git a/src/electron/main.ts b/src/electron/main.ts index 3fa2016..46bd7aa 100644 --- a/src/electron/main.ts +++ b/src/electron/main.ts @@ -178,6 +178,12 @@ app.on("ready", async () => { // HANDLE CLOSE EVENTS // ------------------------------------ // handleCloseEvents(win); + mainWindow.on("close", () => { + if(mainWindow !== null) { + mainWindow.webContents.executeJavaScript(`window.__allowClose__ = true`); + } + }); + }); @@ -197,9 +203,6 @@ app.on('browser-window-focus', () => { // globalShortcut.unregisterAll(); // }); -app.on("window-all-closed", () => { - app.quit(); -}); // --------------------------- diff --git a/src/ui/layout/DashboardLayout.tsx b/src/ui/layout/DashboardLayout.tsx index d066022..2c45e1e 100644 --- a/src/ui/layout/DashboardLayout.tsx +++ b/src/ui/layout/DashboardLayout.tsx @@ -592,7 +592,7 @@ const DashboardLayout = () => { if (!selectedProject?.projectId) return console.log(selectedProject?.projectId, "SelectedProject ID") - socketRef.current = io("https://quality-friendly-goldfish.ngrok-free.app", { + socketRef.current = io("https://portal-sf.docva.com", { transports: ["websocket"], secure: true, rejectUnauthorized: false, diff --git a/src/ui/main.tsx b/src/ui/main.tsx index 5f1d991..9d1b9fc 100644 --- a/src/ui/main.tsx +++ b/src/ui/main.tsx @@ -6,19 +6,34 @@ import { Provider } from "react-redux"; import { store } from "./store"; import { ToastProvider } from './helper/ToastContext'; -// renderer only -// window.addEventListener("online", (e) => { -// console.log("Network online (ignored)"); -// e.preventDefault(); -// }); +declare global { + interface Window { + __allowClose__: boolean; + } +} -// window.addEventListener("offline", (e) => { -// console.log("Network offline (ignored)"); -// e.preventDefault(); -// }); + +// renderer only +window.addEventListener("online", (e) => { + console.log("Network online (ignored)"); + e.preventDefault(); +}); + +window.addEventListener("offline", (e) => { + console.log("Network offline (ignored)"); + e.preventDefault(); +}); // Extra safety -window.onbeforeunload = () => false; +window.__allowClose__ = false; + +window.addEventListener("beforeunload", (e) => { + if (!window.__allowClose__) { + e.returnValue = false; + } +}); + + ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render( diff --git a/src/ui/pages/Vpn/VpnGuard.tsx b/src/ui/pages/Vpn/VpnGuard.tsx index 9f01e0e..060ac20 100644 --- a/src/ui/pages/Vpn/VpnGuard.tsx +++ b/src/ui/pages/Vpn/VpnGuard.tsx @@ -8,7 +8,7 @@ interface Props { const VpnGuard: React.FC = ({ children }) => { const VPN_API = "http://10.0.0.1:3000"; - const DEFAULT_API = "https://quality-friendly-goldfish.ngrok-free.app" + const DEFAULT_API = "https://portal-sf.docva.com" const [checking, setChecking] = useState(true); const [vpnConnected, setVpnConnected] = useState(true);