Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

settings not setting on mac #144

Open
CaiIsProgrammer opened this issue Jan 9, 2021 · 5 comments
Open

settings not setting on mac #144

CaiIsProgrammer opened this issue Jan 9, 2021 · 5 comments

Comments

@CaiIsProgrammer
Copy link

CaiIsProgrammer commented Jan 9, 2021

I don't see any errors but doesn't seem electron settings aren't saving because when I close and reopen my application on mac the saved settings are now reset.

my getting and setting functions

       export const setUser = async (user) => {
          await settings.set("SYQELUser", user.token);
              return true;
            };
            export const getToken = async () => {
              
        export  const user = await settings.get("SYQELUser");
              console.log(user);
            if (user) {
              try {
                  return user;
              } catch (e) {
                  return false;
              }
            }
              return false;
            };
@CaiIsProgrammer
Copy link
Author

still having this issue.

@alphonse92
Copy link

same

@alphonse92
Copy link

I figured out what is happening (at least in my case)

settings returns "/Users/a/Library/Application Support/Electron/settings.json" as currently settings location. However, I could found the settings.json on the same path as electron.app.getPath('userData') folder.

Could you update the library to use electron.app.getPath('userData') as default please?

@alphonse92
Copy link

This is my solution

Screen Shot 2021-01-20 at 15 50 04

@CaiIsProgrammer
Copy link
Author

cool! i just decided to just use local storage for now, but ill see if this fixes it for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants