Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
128 commits
Select commit Hold shift + click to select a range
5395739
Update README.md
ankitsangwan1999 Sep 30, 2021
81e152f
Merge pull request #11 from ankitsangwan1999/master
ankitsangwan1999 Sep 30, 2021
d9ae068
Merge branch 'ankitsangwan1999:main' into main
ankitsangwan1999 Sep 30, 2021
3057654
Added Mentor Name
pirateksh Oct 1, 2021
aef4487
Merge pull request #12 from pirateksh/main
pirateksh Oct 1, 2021
8b7bf2d
Update README.md
ankitsangwan1999 Oct 2, 2021
9e82a94
Merge branch 'main' into main
ankitsangwan1999 Oct 6, 2021
4b67b74
added new column for question id
rishigarg94 Oct 7, 2021
56fce37
Tabular view of the Attempted questions list
prbhatter Oct 8, 2021
d2ae41a
issue #10 fixed the colour issues
rishigarg94 Oct 8, 2021
cba5747
typo fixed
umang537 Oct 8, 2021
aedc877
Merge pull request #23 from Umang-19/main
ankitsangwan1999 Oct 8, 2021
edfb440
Merge pull request #21 from rishigarg94/main
ankitsangwan1999 Oct 8, 2021
aa221b6
Attempted Questions issues resolved and commented
prbhatter Oct 8, 2021
f983fe6
Updated Contributors
Divyanshi070700 Oct 8, 2021
abe4177
Merge pull request #22 from prbhatter/attemptedQuestionsFeature
ankitsangwan1999 Oct 8, 2021
805ce97
Update CONTRIBUTORS.md
gursimran18 Oct 8, 2021
23b5e2f
Merge pull request #28 from gursimran18/contribution2
ankitsangwan1999 Oct 8, 2021
5e15659
Merge pull request #26 from Divyanshi070700/Contributer
ankitsangwan1999 Oct 8, 2021
3cf2ec5
Update CONTRIBUTORS.md
mansi0703 Oct 8, 2021
b37d509
Update CONTRIBUTORS.md
mansi0703 Oct 8, 2021
1d61447
Merge branch 'main' into Contributing
ankitsangwan1999 Oct 8, 2021
6622a2d
Merge pull request #29 from mansi0703/Contributing
ankitsangwan1999 Oct 8, 2021
a29a371
Ac and NotAc Table added
prbhatter Oct 8, 2021
fc98b90
Merge pull request #30 from prbhatter/acNotac
ankitsangwan1999 Oct 9, 2021
3d70cd8
Restrict the Window resizing of the App Window to not less than (300X…
dev1bryant Oct 9, 2021
d390416
Renamed NavBar with Header
dev1bryant Oct 9, 2021
d9b0f47
Update CONTRIBUTORS.md
sudhanshu1221 Oct 9, 2021
dfa6cd0
Changed the Navbar component to Header.
metakunal Oct 10, 2021
51ce167
Update main.js
ankitsangwan1999 Oct 10, 2021
dd493fa
Merge pull request #33 from MrRobot2025/main
ankitsangwan1999 Oct 10, 2021
b7562f8
Reloads the Application when clicked on logo
NeerajChatterjee Oct 10, 2021
85f2552
Merge branch 'main' into main
ankitsangwan1999 Oct 10, 2021
34f1e57
Merge pull request #34 from metakunal/main
ankitsangwan1999 Oct 10, 2021
738dcc5
modified scrollbar and changed its color to neongreen
dev-lovedeep Oct 10, 2021
b18fc73
Added comments and styled cursor
NeerajChatterjee Oct 10, 2021
4f59195
added a scrollable div in styles
dev-lovedeep Oct 11, 2021
233887a
modified the scrollbar properties like width,color etc
dev-lovedeep Oct 11, 2021
c1271a0
applied scrollable div on all categories question table
dev-lovedeep Oct 11, 2021
755d32b
Button to pick a Random Problem currently chosen Category
mrpirated Oct 11, 2021
45921e1
Merge pull request #36 from dev-lovedeep/styled-scrollbar
ankitsangwan1999 Oct 11, 2021
583c5cd
Update CONTRIBUTORS.md
always0p Oct 11, 2021
5770d35
Event Names implemented in Constant.js
NeerajChatterjee Oct 11, 2021
1764e28
Created a style.css for logo
NeerajChatterjee Oct 11, 2021
f12b37a
Update Constants.js
ankitsangwan1999 Oct 11, 2021
9430b57
Update style.css
ankitsangwan1999 Oct 11, 2021
601f43c
styled the logo with cursor pointer
NeerajChatterjee Oct 12, 2021
fce33f2
styled logo
NeerajChatterjee Oct 12, 2021
d43ff34
Getting started..
verma-verse Oct 12, 2021
7319928
logout functionality implemented
prbhatter Oct 12, 2021
13ed8f1
Merge pull request #32 from prbhatter/logoutFunction
ankitsangwan1999 Oct 12, 2021
78061d0
deleted and modified files not required
NeerajChatterjee Oct 12, 2021
79798fe
Merge pull request #31 from sudhanshu1221/patch-1
ankitsangwan1999 Oct 12, 2021
9a2fdbc
Merge branch 'main' into patch-1
ankitsangwan1999 Oct 12, 2021
c2368ae
Merge pull request #40 from Ashish-Verma-MNNIT/patch-1
ankitsangwan1999 Oct 12, 2021
3283e77
Merge branch 'main' into patch-1
ankitsangwan1999 Oct 12, 2021
4c6747d
Merge pull request #39 from always0p/patch-1
ankitsangwan1999 Oct 12, 2021
f36f92a
newline added and merged with previous changed
mrpirated Oct 12, 2021
6905534
Replaced Event Names with Variable names stored in Constants.js in th…
geeqib23 Oct 12, 2021
04bb41c
Resolved Conflicts with upstream:main
ankitsangwan1999 Oct 12, 2021
bb5c6fc
Update Constants.js
ankitsangwan1999 Oct 12, 2021
358c2a8
Update AppContent.js
ankitsangwan1999 Oct 12, 2021
b005f4d
Merge pull request #35 from NeerajChatterjee/main
ankitsangwan1999 Oct 12, 2021
bbea01f
Paid column added
mrpirated Oct 13, 2021
5903639
part one done, icon not visible in part two
mrpirated Oct 13, 2021
f073679
Update CONTRIBUTORS.md
Yashikaj14 Oct 13, 2021
997af9d
Update CONTRIBUTORS.md
abhijeetp94 Oct 13, 2021
39ce6a2
pull updtream
geeqib23 Oct 14, 2021
d8d8913
pull upstream
geeqib23 Oct 14, 2021
0707583
Merge branch 'main' of github.com:geeqib23/LeetSolve
geeqib23 Oct 14, 2021
9b82ede
Merge pull request #42 from geeqib23/main
ankitsangwan1999 Oct 14, 2021
46ff52f
icon fixed
mrpirated Oct 14, 2021
ac551f7
Made the App by default open in Full Screen.
metakunal Oct 15, 2021
368d724
changed tooltip style and added proptypes
mrpirated Oct 15, 2021
3886f5f
Merge branch 'main' of https://github.com/ContriHUB/LeetSolve
mrpirated Oct 15, 2021
3b6d88d
merged changes
mrpirated Oct 15, 2021
a49813a
Merge pull request #38 from mrpirated/main
ankitsangwan1999 Oct 15, 2021
dc200c7
Update CONTRIBUTORS.md
shivani4208 Oct 15, 2021
d05dab3
Removed comments
metakunal Oct 17, 2021
ea93731
Merge pull request #50 from metakunal/main
ankitsangwan1999 Oct 17, 2021
c03b5fc
Update CONTRIBUTORS.md
rdx-rockstar Oct 18, 2021
be7a540
Merge pull request #52 from rdx-rockstar/patch-1
ankitsangwan1999 Oct 18, 2021
fa9ad2b
Merge branch 'main' into main
ankitsangwan1999 Oct 18, 2021
56ca403
Merge pull request #51 from shivani4208/main
ankitsangwan1999 Oct 18, 2021
eafb525
Merge branch 'main' into patch-1
ankitsangwan1999 Oct 18, 2021
608d4a8
Merge pull request #48 from abhijeetp94/patch-1
ankitsangwan1999 Oct 18, 2021
3f9e296
Merge pull request #47 from Yashikaj14/patch-1
ankitsangwan1999 Oct 18, 2021
d488a03
reload button added
taru2001 Oct 19, 2021
a8f2b70
reload button added
taru2001 Oct 19, 2021
c7eac9b
Adding reload button in the progress bar
taru2001 Oct 19, 2021
9cea74b
Update CONTRIBUTORS.md
AbhayD11 Oct 20, 2021
f8159b8
fade after submission
kratibarkhania Oct 20, 2021
2a81f12
reload icon added
taru2001 Oct 21, 2021
190bbaa
Merge pull request #54 from AbhayD11/patch-1
ankitsangwan1999 Oct 22, 2021
bb6ddf5
comments deleted and padding-left set to 1 rem and css added to file …
taru2001 Oct 22, 2021
ff29162
Merge pull request #53 from taru2001/main
ankitsangwan1999 Oct 22, 2021
1496424
corrected the fade out feature
kratibarkhania Oct 23, 2021
6badec5
Merge pull request #55 from kratibarkhania/master
ankitsangwan1999 Oct 23, 2021
6202533
Update CONTRIBUTORS.md
AmitGupta7580 Oct 23, 2021
0b2d9aa
Update CONTRIBUTORS.md
tiwarirajdeep Oct 24, 2021
c2150ee
Merge pull request #58 from AmitGupta7580/Modifying-CONTRIBUTORS.md
ankitsangwan1999 Oct 25, 2021
1e4cc90
Merge branch 'main' into patch-1
ankitsangwan1999 Oct 25, 2021
9ea49b2
Merge pull request #59 from tiwarirajdeep/patch-1
ankitsangwan1999 Oct 25, 2021
ddaccc8
Fixed a name
ankitsangwan1999 Oct 25, 2021
b82d042
AllQuestions Page paginated with custom size
Oct 25, 2021
722d26e
Update CONTRIBUTORS.md
just-a-n00b Oct 26, 2021
c76508f
footer modified
kratibarkhania Oct 27, 2021
280a0d6
improved footer
kratibarkhania Oct 27, 2021
5c0d95c
styling of buttons
Oct 27, 2021
f13949b
improved animation style
kratibarkhania Oct 28, 2021
030f48a
fontFamily added in css
Oct 28, 2021
1d3243a
implemented virtual contest feature
prbhatter Oct 28, 2021
578ffbe
Merge branch 'main' into virtualContest
prbhatter Oct 28, 2021
26ad13c
Merge branch 'main' into virtualContest
prbhatter Oct 29, 2021
bca3de7
Merge pull request #60 from g-yash-10/paginate
ankitsangwan1999 Oct 29, 2021
cf9b6ee
Merge pull request #62 from kratibarkhania/master
ankitsangwan1999 Oct 29, 2021
789de23
Merge pull request #61 from just-a-n00b/name_add
ankitsangwan1999 Oct 29, 2021
d37be66
added contributor
kratibarkhania Oct 30, 2021
fdb0635
Virtual Contest improved and Added Timer
prbhatter Oct 30, 2021
6f889e6
Pagination added to other tables as well
kunal2812 Oct 30, 2021
2a7c874
Merge pull request #65 from kratibarkhania/master
ankitsangwan1999 Oct 31, 2021
634322f
Merge branch 'main' into virtualContest
prbhatter Oct 31, 2021
96d0044
removed the timer part
prbhatter Oct 31, 2021
4b605fb
Merge pull request #66 from kunal2812/main
ankitsangwan1999 Oct 31, 2021
50f18ff
Fetching status updated
prbhatter Oct 31, 2021
39c3569
Merge branch 'main' into virtualContest
prbhatter Oct 31, 2021
5a332e1
solved the issue on contest end
prbhatter Nov 8, 2021
5c887cc
Merge pull request #64 from prbhatter/virtualContest
ankitsangwan1999 Nov 9, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,27 @@ Here's to the crazy ones:
<tr>
<td align="center"><a href="https://github.com/ankitsangwan1999"><img src="https://github.com/ankitsangwan1999.png?v=4?s=100" width="100px;" alt="Ankit Sangwan"/><br /><sub><b>Ankit Sangwan</b></sub></a><br /></td>
<td align="center"><a href="https://github.com/harshit-2007"><img src="https://github.com/Harshit-2007.png.png?v=4?s=100" width="100px;" alt="Harshit Chaudhary"/><br /><sub><b>Harshit Chaudhary</b></sub></a><br /></td>
<td align="center"><a href="https://github.com/mansi0703"><img src="https://github.com/mansi0703.png.png?v=4?s=100" width="100px;" alt="Mansi Sahu"/><br /><sub><b>Mansi Sahu</b></sub></a><br /></td>
<td align="center"><a href="https://github.com/Divyanshi070700"><img src="https://github.com/Divyanshi070700.png.png?v=4?s=100" width="100px;" alt="Divyanshi Agrawal"/><br /><sub><b>Divyanshi Agrawal</b></sub></a><br /></td>
<td align="center"><a href="https://github.com/gursimran18"><img src="https://github.com/gursimran18.png.png?v=4?s=100" width="100px;" alt="Gursimran Kaur Saini"/><br /><sub><b>Gursimran Kaur Saini</b></sub></a><br /></td>
<td align="center"><a href="https://github.com/Ashish-Verma-MNNIT"><img src="https://github.com/Ashish-Verma-MNNIT.png?v=4?s=100" width="100px;" alt="Ashish Verma"/><br /><sub><b>Ashish Verma</b></sub></a><br /></td>
<td align="center"><a href="https://github.com/gursimran18"><img src="https://github.com/gursimran18.png.png?v=4?s=100" width="100px;" alt="Gursimran Kaur Saini"/><br /><sub><b>Gursimran Kaur Saini</b></sub></a><br /></td>
</tr>

<tr>
<td align="center"><a href="https://github.com/abhijeetp94"><img src="https://github.com/abhijeetp94.png?v=4?s=100" width="100px;" alt="Abhijeet Pandey"/><br /><sub><b>Abhijeet Pandey</b></sub></a><br /></td>
<td align="center"><a href="https://github.com/gursimran18"><img src="https://github.com/gursimran18.png.png?v=4?s=100" width="100px;" alt="Gursimran Kaur Saini"/><br /><sub><b>Gursimran Kaur Saini</b></sub></a><br /></td>
<td align="center"><a href="ttps://github.com/always0p"><img src="https://github.com/always0p.png.png?v=4?s=100" width="100px;" alt="Jaspal Singh"/><br /><sub><b>Jaspal Singh</b></sub></a><br /></td>
<td align="center"><a href="https://github.com/sudhanshu1221"><img src="https://github.com/sudhanshu1221.png.png?v=4?s=100" width="100px;" alt="Sudhanshu Kumar"/><br /><sub><b>Sudhanshu Kumar</b></sub></a><br /></td>
<td align="center"><a href="https://github.com/Yashikaj14"><img src="https://github.com/Yashikaj14.png.png?v=4?s=100" width="100px;" alt="Yashika Jain"/><br /><sub><b>Yashika Jain</b></sub></a><br /></td>
<td align="center"><a href="https://github.com/shivani4208"><img src="https://github.com/shivani4208.png?v=4?s=100" width="100px;" alt="Shivani Kumari"/><br /><sub><b>Shivani Kumari</b></sub></a><br /></td>
<td align="center"><a href="https://github.com/rdx-rockstar"><img src="https://github.com/rdx-rockstar.png.png?v=4?s=100" width="100px;" alt="Karimulla Mohammad"/><br /><sub><b>Karimulla Mohammad</b></sub></a><br /></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/AbhayD11"><img src="https://github.com/AbhayD11.png.png?v=4?s=100" width="100px;" alt="Abhay Dixit"/><br /><sub><b>Abhay Dixit</b></sub></a><br /></td>
<td align="center"><a href="https://github.com/tiwarirajdeep"><img src="https://github.com/tiwarirajdeep.png.png?v=4?s=100" width="100px;" alt="Rajdeep Tiwari"/><br /><sub><b>Rajdeep Tiwari</b></sub></a><br /></td>
<td align="center"><a href="https://github.com/AmitGupta7580"><img src="https://github.com/AmitGupta7580.png.png?v=4?s=100" width="100px;" alt="Amit Gupta"/><br /><sub><b>Amit Gupta</b></sub></a><br /></td>
<td align="center"><a href="https://github.com/just-a-n00b"><img src="https://github.com/just-a-n00b.png.png?v=4?s=100" width="100px;" alt="Naman Mittal"/><br /><sub><b>Naman Mittal</b></sub></a><br /></td>
<td align="center"><a href="https://github.com/kratibarkhania"><img src="https://github.com/kratibarkhania.png.png?v=4?s=100" width="100px;" alt="Krati Barkhania"/><br /><sub><b>Krati Barkhania</b></sub></a><br /></td>
</tr>
</table>
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Sometimes back **Leetcode** did not show all the **attempted** problems(AC/Non-AC) by the user at one place. Particularly, **Non-AC** problems are important for students preparing for **interviews** as they want to solve them eventually. Categorizing all such problems based on their **Difficulty Level** and **Acceptance Rate** becomes helpful.


## How to run it locally?
## How to run locally?
1. > ***Clone this repo to your local machine and cd into the LeetSolve directory.***
2. npm i
> This will download all the required dependencies for the application to run on your local machine.
Expand Down Expand Up @@ -38,5 +38,9 @@ Step-3:
## Are there any tips/guidelines for contributors under [ContriHUB-21](http://contrihub21.herokuapp.com/)?
Yes. Check [CONTRIBUTING.md](CONTRIBUTING.md)

## Where to add the contributors name for [ContriHUB-21](http://contrihub21.herokuapp.com/)?
Inside [CONTRIBUTORS.md](CONTRIBUTORS.md) file.
## Where to add contributors name for [ContriHUB-21](http://contrihub21.herokuapp.com/)?
Check [CONTRIBUTORS.md](CONTRIBUTORS.md)

## Mentors
* [Ankit Sangwan](https://github.com/ankitsangwan1999)

35 changes: 35 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,44 @@
flex-direction: column;
}

.reload {
color: #39ff14;
background-color:unset;
cursor: pointer;
border: none;
font-weight: bolder;
padding-left: 1rem;

}

code {
font-family: "Cool Font";
}
/* below styles is for global scrollbars */
/* width */
::-webkit-scrollbar {
width: 10px;
}

/* Track */
::-webkit-scrollbar-track {
outline: 1px solid green;
}

/* Handle */
::-webkit-scrollbar-thumb {
background: #39ff14;
border-radius: 25px;
min-height: 40px;
}
::-webkit-scrollbar-corner {
background-color: transparent;
}

/*Handle on hover */
::-webkit-scrollbar-thumb:hover {
background: #33cd31;
}
</style>
</head>

Expand Down
77 changes: 49 additions & 28 deletions main.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,24 @@
import "regenerator-runtime/runtime"; // To be able to use async-await syntax
const { app, BrowserWindow, ipcMain, shell, session } = require("electron");
const {
app,
BrowserWindow,
ipcMain,
shell,
session,
screen,
} = require("electron");
const path = require("path");
const url = require("url");
const axios = require("axios");
import checkCookieValidity from "./src/api/CheckCookieValidity";
import makeCookie from "./src/api/makeCookie";
import { API_URL, TIME_OUT_LIMIT } from "./src/Constants";
import {
API_URL,
LOGOUT_EVENT,
USER_DATA_EVENT,
HANDLE_FORM_EVENT,
TIME_OUT_LIMIT,
} from "./src/Constants";

// for DEV purpose only
import smallResponse from "./src/DummyData/smallResponse";
Expand All @@ -15,15 +28,17 @@ let mainWindow, cookieJar;

const createWindow = () => {
mainWindow = new BrowserWindow({
width: 1000,
height: 800,
show: false,
icon: __dirname + "/src/static/images/icon.png",
webPreferences: {
nodeIntegration: true,
contextIsolation: false,
},

autoHideMenuBar: true,
});
mainWindow.maximize();
mainWindow.show();
cookieJar = session.defaultSession.cookies;

mainWindow.loadURL(
Expand All @@ -47,7 +62,7 @@ const createWindow = () => {
};

// Catch handle-form event
ipcMain.on("handle-form", async (e, cookie) => {
ipcMain.on(HANDLE_FORM_EVENT, async (e, cookie) => {
cookie = cookie.trim();
console.log("Server: Received handle-form event with cookie:", cookie);
const cookieHeaderString = `LEETCODE_SESSION=${cookie};`;
Expand Down Expand Up @@ -84,7 +99,7 @@ ipcMain.on("handle-form", async (e, cookie) => {
.catch((err) => {
console.log("ERROR: While Getting All Cookie Values");
});
mainWindow.webContents.send("user-data", response);
mainWindow.webContents.send(USER_DATA_EVENT, response);
})
.catch((err) => {
console.log("ERROR: While Setting Cookie.", err);
Expand All @@ -97,12 +112,12 @@ ipcMain.on("handle-form", async (e, cookie) => {
"This Cookie is either invalid or expired./Req Timed Out",
response
);
mainWindow.webContents.send("user-data", response);
mainWindow.webContents.send(USER_DATA_EVENT, response);
}
});

// Catch user-data event emitted by Client
ipcMain.on("user-data", async (e) => {
ipcMain.on(USER_DATA_EVENT, async (e) => {
// TESTING BEGINS
// cookieJar
// .set(makeCookie(<ENTER_YOUR_COOKIE_HERE>))
Expand All @@ -113,17 +128,6 @@ ipcMain.on("user-data", async (e) => {
// console.log("Can't Set");
// });

// To remove a cookie: Will be used in logout, inside a different even i.e. user-logout
// try {
// await cookieJar.remove(
// "https://leetsolve.matrix.com",
// "MY_TASTY_COOKIE"
// );
// console.log("Cookie Removed");
// } catch (e) {
// console.log("Problem Removing the cookie", e);
// }

// TESTING ENDS

cookieJar
Expand All @@ -137,7 +141,7 @@ ipcMain.on("user-data", async (e) => {
const response = await checkCookieValidity(
cookieHeaderString
);
mainWindow.webContents.send("user-data", response);
mainWindow.webContents.send(USER_DATA_EVENT, response);
} catch (response) {
if (response.message.isTimeOut) {
console.log(
Expand All @@ -151,7 +155,7 @@ ipcMain.on("user-data", async (e) => {
);
}

mainWindow.webContents.send("user-data", response);
mainWindow.webContents.send(USER_DATA_EVENT, response);
}
} else {
console.log("ERROR: Can't Find Your Cookie");
Expand All @@ -165,7 +169,7 @@ ipcMain.on("user-data", async (e) => {
},
data: {},
};
mainWindow.webContents.send("user-data", response);
mainWindow.webContents.send(USER_DATA_EVENT, response);
}
})
.catch((err) => {
Expand Down Expand Up @@ -194,19 +198,19 @@ ipcMain.on("user-data", async (e) => {
// console.log("This Cookie is either invalid or expired.");
// response.message.isCookieValid = false;
// response.message.isTimeOut = false;
// mainWindow.webContents.send("user-data", response);
// mainWindow.webContents.send(USER_DATA_EVENT, response);
// } else {
// console.log("Hi", response.message.username);
// response.message.isCookieValid = true;
// response.message.isTimeOut = false;
// mainWindow.webContents.send("user-data", response);
// mainWindow.webContents.send(USER_DATA_EVENT, response);
// }
// })
// .catch((err) => {
// console.log("May be Request took long time to reply...", err);
// response.message.isTimeOut = true;
// response.message.isCookieValid = true; // Doesn't matter when isTimeOut = true
// mainWindow.webContents.send("user-data", response);
// mainWindow.webContents.send(USER_DATA_EVENT, response);
// });

/**
Expand All @@ -224,22 +228,39 @@ ipcMain.on("user-data", async (e) => {
// console.log("This Cookie is either invalid or expired.");
// response.message.isCookieValid = false;
// response.message.isTimeOut = false;
// mainWindow.webContents.send("user-data", response);
// mainWindow.webContents.send(USER_DATA_EVENT, response);
// } else {
// console.log("Hi", response.message.username);
// response.message.isCookieValid = true;
// response.message.isTimeOut = false;
// mainWindow.webContents.send("user-data", response);
// mainWindow.webContents.send(USER_DATA_EVENT, response);
// }
// })
// .catch((err) => {
// console.log("May be Request took long time to reply...", err);
// response.message.isTimeOut = true;
// response.message.isCookieValid = true; // Doesnot matter when isTimeOut = true
// mainWindow.webContents.send("user-data", response);
// mainWindow.webContents.send(USER_DATA_EVENT, response);
// });
});

ipcMain.handle(LOGOUT_EVENT, async (event) => {
//To handle when "user-logout" event is invoked from UI renderer side(LogOut.js)
try {
await cookieJar.remove(
//Removing the saved cookie
"https://leetsolve.matrix.com",
"MY_TASTY_COOKIE"
);
console.log("Cookie Removed");
BrowserWindow.getFocusedWindow().reload(); //Reloading the window when logout is successful
return "success";
} catch (e) {
console.log("Problem Removing the cookie", e);
return "fail";
}
});

// Spawning the Main Window
app.on("ready", createWindow);

Expand Down
Loading