electron-settings
electron-settings copied to clipboard
settings not setting on mac
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;
};
still having this issue.
same
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?
This is my solution

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