Fix UserNameDialog open error and add defensive ref check

- Added ref="userNameDialog" to UserNameDialog in AccountViewView.vue template
- Patched onEditName() to check for dialog ref and open() method before calling
- Improved error notification to use NotificationIface fields (group, type, title, text)
- Prevents "Cannot read properties of undefined (reading 'open')" error if dialog is missing
This commit is contained in:
Matthew Raymer
2025-07-06 11:08:34 +00:00
parent 64e78fdbce
commit 86fd73051a
9 changed files with 716 additions and 24 deletions

View File

@@ -38,11 +38,13 @@
import { Vue, Component, Prop } from "vue-facing-decorator";
import { NotificationIface } from "../constants/app";
import * as databaseUtil from "../db/databaseUtil";
import { MASTER_SETTINGS_KEY } from "../db/tables/settings";
import { PlatformServiceFactory } from "@/services/PlatformServiceFactory";
import { PlatformServiceMixin } from "@/utils/PlatformServiceMixin";
@Component
@Component({
mixins: [PlatformServiceMixin],
})
export default class UserNameDialog extends Vue {
$notify!: (notification: NotificationIface, timeout?: number) => void;
@@ -62,7 +64,7 @@ export default class UserNameDialog extends Vue {
*/
async open(aCallback?: (name?: string) => void) {
this.callback = aCallback || this.callback;
const settings = await databaseUtil.retrieveSettingsForActiveAccount();
const settings = await this.$settings();
this.givenName = settings.firstName || "";
this.visible = true;
}