mirror of
https://github.com/tiddly-gittly/TidGi-Desktop.git
synced 2026-03-09 08:20:32 -07:00
fix: wrong key in setting
This commit is contained in:
parent
844138e739
commit
8a02680c0b
3 changed files with 4 additions and 4 deletions
|
|
@ -57,7 +57,7 @@ export class Authentication implements IAuthenticationService {
|
|||
* load UserInfos in sync, and ensure it is an Object
|
||||
*/
|
||||
private readonly getInitUserInfoForCache = (): IUserInfos => {
|
||||
let userInfosFromDisk = settings.getSync(`userInfo.${this.version}`) ?? {};
|
||||
let userInfosFromDisk = settings.getSync(`userInfos.${this.version}`) ?? {};
|
||||
userInfosFromDisk = typeof userInfosFromDisk === 'object' && !Array.isArray(userInfosFromDisk) ? userInfosFromDisk : {};
|
||||
return { ...defaultUserInfos, ...this.sanitizeUserInfo(userInfosFromDisk) };
|
||||
};
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ export class Preference implements IPreferenceService {
|
|||
this.cachedPreferences[key] = value;
|
||||
this.cachedPreferences = { ...this.cachedPreferences, ...this.sanitizePreference(this.cachedPreferences) };
|
||||
|
||||
void settings.set(`preferences.${this.version}.${key}`, this.cachedPreferences[key]);
|
||||
void settings.set(`preferences.${this.version}.${key}`, this.cachedPreferences[key] as any);
|
||||
|
||||
this.reactWhenPreferencesChanged(key, value);
|
||||
this.updatePreferenceSubject();
|
||||
|
|
@ -107,7 +107,7 @@ export class Preference implements IPreferenceService {
|
|||
*/
|
||||
private async setPreferences(newPreferences: IPreferences): Promise<void> {
|
||||
this.cachedPreferences = newPreferences;
|
||||
await settings.set(`preferences.${this.version}`, { ...newPreferences });
|
||||
await settings.set(`preferences.${this.version}`, { ...newPreferences } as any);
|
||||
this.updatePreferenceSubject();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -311,7 +311,7 @@ export class Workspace implements IWorkspaceService {
|
|||
newImage.clone().resize(128, 128).quality(100).write(destinationPicturePath, resolve);
|
||||
});
|
||||
const currentPicturePath = this.get(id)?.picturePath;
|
||||
await this.update(id, {
|
||||
this.update(id, {
|
||||
picturePath: destinationPicturePath,
|
||||
});
|
||||
// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue