Compare commits

...
Author SHA1 Message Date
Jose Olarte III 5f8d1fc8c6 refactor: remove deprecated lastName field from user settings
- Remove lastName field from $saveUserSettings and $saveSettings calls
- Clean up deprecated pre v0.1.3 code
2025-09-01 16:54:36 +08:00
Jose Olarte III dde37e73e1 Lint fixes 2025-08-29 16:41:46 +08:00
Jose Olarte III 83c0c18db2 fix: persist identity names per user instead of globally
Fixes issue where identity names were not saved when switching between
multiple identities. Names were being saved to master settings instead
of user-specific settings.

Changes:
- UserNameDialog: Load/save names from/to user-specific settings
- NewEditAccountView: Save names to user-specific settings for active DID
- Both components now use $accountSettings() and $saveUserSettings()
  instead of $settings() and $updateSettings()

Each identity now properly retains their assigned name when switching
between identities. Previously only "User Zero" would show their name
due to using master settings instead of per-identity settings.

Fixes: Identity name persistence across identity switches
2025-08-29 16:41:19 +08:00
2 changed files with 30 additions and 6 deletions
+14 -2
View File
@@ -84,7 +84,8 @@ export default class UserNameDialog extends Vue {
*/ */
async open(aCallback?: (name?: string) => void) { async open(aCallback?: (name?: string) => void) {
this.callback = aCallback || this.callback; this.callback = aCallback || this.callback;
const settings = await this.$settings(); // Load from account-specific settings instead of master settings
const settings = await this.$accountSettings();
this.givenName = settings.firstName || ""; this.givenName = settings.firstName || "";
this.visible = true; this.visible = true;
} }
@@ -95,7 +96,18 @@ export default class UserNameDialog extends Vue {
*/ */
async onClickSaveChanges() { async onClickSaveChanges() {
try { try {
await this.$updateSettings({ firstName: this.givenName }); // Get the current active DID to save to user-specific settings
const settings = await this.$accountSettings();
const activeDid = settings.activeDid;
if (activeDid) {
// Save to user-specific settings for the current identity
await this.$saveUserSettings(activeDid, { firstName: this.givenName });
} else {
// Fallback to master settings if no active DID
await this.$saveSettings({ firstName: this.givenName });
}
this.visible = false; this.visible = false;
this.callback(this.givenName); this.callback(this.givenName);
} catch (error) { } catch (error) {
+14 -2
View File
@@ -110,10 +110,22 @@ export default class NewEditAccountView extends Vue {
* @async * @async
*/ */
async onClickSaveChanges() { async onClickSaveChanges() {
await this.$updateSettings({ // Get the current active DID to save to user-specific settings
const settings = await this.$accountSettings();
const activeDid = settings.activeDid;
if (activeDid) {
// Save to user-specific settings for the current identity
await this.$saveUserSettings(activeDid, {
firstName: this.givenName, firstName: this.givenName,
lastName: "", // deprecated, pre v 0.1.3
}); });
} else {
// Fallback to master settings if no active DID
await this.$saveSettings({
firstName: this.givenName,
});
}
this.$router.back(); this.$router.back();
} }