Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on May 4, 2023. It is now read-only.

Commit 8061e43

Browse filesBrowse files
fix: cache and check on login
1 parent d41a6dc commit 8061e43
Copy full SHA for 8061e43

File tree

7 files changed

+13
-7
lines changed
Filter options

7 files changed

+13
-7
lines changed

‎package-lock.json

Copy file name to clipboardExpand all lines: package-lock.json
+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

Copy file name to clipboardExpand all lines: package.json
+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"coding-assistant",
77
"codiga"
88
],
9-
"version": "0.0.17",
9+
"version": "0.0.18",
1010
"homepage": "https://www.codiga.io/",
1111
"bugs": {
1212
"url": "https://github.com/codiga/code-snippets-manager/issues"

‎release/app/package-lock.json

Copy file name to clipboardExpand all lines: release/app/package-lock.json
+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎release/app/package.json

Copy file name to clipboardExpand all lines: release/app/package.json
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "codiga",
3-
"version": "0.0.17",
3+
"version": "0.0.18",
44
"description": "Codiga Code Snippets Manager",
55
"license": "MIT",
66
"author": {

‎src/renderer/components/Layout/SideMenu.tsx

Copy file name to clipboardExpand all lines: src/renderer/components/Layout/SideMenu.tsx
+2
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ export default function SideMenu({ openLoginModal }: SideMenuProps) {
105105
localStorage.removeItem(TOKEN);
106106
setUser({});
107107
navigate('/');
108+
await apolloClient.clearStore();
109+
await apolloClient.cache.reset();
108110
await apolloClient.resetStore();
109111
} catch (err) {
110112
// eslint-disable-next-line no-console

‎src/renderer/components/Login/Login.tsx

Copy file name to clipboardExpand all lines: src/renderer/components/Login/Login.tsx
+5-2
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,12 @@ export default function Login({ isOpen, closeModal }: LoginProps) {
5353
// set the token in localStorarge, which the apollo client will grab
5454
localStorage.setItem(TOKEN, formData.token);
5555
// check if a user is returned now
56-
const { data } = await validateToken();
56+
const { data, error } = await validateToken({
57+
fetchPolicy: 'network-only',
58+
nextFetchPolicy: 'network-only',
59+
});
5760
// valid token, close/reset modal, otherwise remove token and show an error to the user
58-
if (data?.user) {
61+
if (data?.user && !error) {
5962
setUser(data.user);
6063
closeAndReset();
6164
} else {

‎src/renderer/components/UserContext/UserContext.tsx

Copy file name to clipboardExpand all lines: src/renderer/components/UserContext/UserContext.tsx
+2-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ export const UserProvider = ({ children }: { children: ReactNode }) => {
1515

1616
useQuery<{ user: Partial<User> }>(CHECK_USER, {
1717
pollInterval: POLL_USER_FOR_LOGOUT_MSEC,
18-
fetchPolicy: 'no-cache',
18+
fetchPolicy: 'network-only',
19+
nextFetchPolicy: 'network-only',
1920
onCompleted: (respData) => {
2021
if (respData?.user) {
2122
setUser(respData?.user);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.