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

@@ -100,7 +100,7 @@ import {
} from "@vue-leaflet/vue-leaflet";
import { Router } from "vue-router";
import * as databaseUtil from "../db/databaseUtil";
import { PlatformServiceMixin } from "@/utils/PlatformServiceMixin";
@Component({
components: {
@@ -109,6 +109,7 @@ import * as databaseUtil from "../db/databaseUtil";
LMarker,
LTileLayer,
},
mixins: [PlatformServiceMixin],
})
export default class FeedFilters extends Vue {
$router!: Router;
@@ -122,7 +123,7 @@ export default class FeedFilters extends Vue {
async open(onCloseIfChanged: () => void) {
this.onCloseIfChanged = onCloseIfChanged;
const settings = await databaseUtil.retrieveSettingsForActiveAccount();
const settings = await this.$settings();
this.hasVisibleDid = !!settings.filterFeedByVisible;
this.isNearby = !!settings.filterFeedByNearby;
if (settings.searchBoxes && settings.searchBoxes.length > 0) {
@@ -136,7 +137,7 @@ export default class FeedFilters extends Vue {
async toggleHasVisibleDid() {
this.settingChanged = true;
this.hasVisibleDid = !this.hasVisibleDid;
await databaseUtil.updateDefaultSettings({
await this.$updateSettings({
filterFeedByVisible: this.hasVisibleDid,
});
}
@@ -144,7 +145,7 @@ export default class FeedFilters extends Vue {
async toggleNearby() {
this.settingChanged = true;
this.isNearby = !this.isNearby;
await databaseUtil.updateDefaultSettings({
await this.$updateSettings({
filterFeedByNearby: this.isNearby,
});
}
@@ -154,7 +155,7 @@ export default class FeedFilters extends Vue {
this.settingChanged = true;
}
await databaseUtil.updateDefaultSettings({
await this.$updateSettings({
filterFeedByNearby: false,
filterFeedByVisible: false,
});
@@ -168,7 +169,7 @@ export default class FeedFilters extends Vue {
this.settingChanged = true;
}
await databaseUtil.updateDefaultSettings({
await this.$updateSettings({
filterFeedByNearby: true,
filterFeedByVisible: true,
});