Added Logout Option
This commit is contained in:
parent
b0d296e007
commit
85a178e825
|
|
@ -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]
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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) => {
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
});
|
||||
|
||||
|
||||
// ---------------------------
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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(
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ interface Props {
|
|||
const VpnGuard: React.FC<Props> = ({ 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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue