fix: ClaimView now correctly displays User #0 registration status

Fix ClaimView component to use $accountSettings() instead of $settings() to
get the current user's registration status. This resolves the issue where
User #0 appeared unregistered in ClaimView despite having isRegistered: true
in the database.

- Changed created() method to use $accountSettings() for user-specific settings
- Ensures ClaimView reads correct isRegistered value for current user
- Fixes "You posted that. false" display issue for registered users
This commit is contained in:
Matthew Raymer
2025-07-27 05:03:52 +00:00
parent 820fb29021
commit 45e5b86b0a
8 changed files with 223 additions and 59 deletions

View File

@@ -3,6 +3,17 @@
<h2>PlatformServiceMixin Test</h2>
<button @click="testInsert">Test Insert</button>
<button @click="testUpdate">Test Update</button>
<button
:class="primaryButtonClasses"
@click="testUserZeroSettings"
>
Test User #0 Settings
</button>
<div v-if="userZeroTestResult" class="mt-4 p-4 border border-gray-300 rounded-md bg-gray-50">
<h4 class="font-semibold mb-2">User #0 Settings Test Result:</h4>
<pre class="text-sm">{{ JSON.stringify(userZeroTestResult, null, 2) }}</pre>
</div>
<pre>{{ result }}</pre>
</div>
</template>
@@ -16,6 +27,7 @@ import { PlatformServiceMixin } from "@/utils/PlatformServiceMixin";
})
export default class PlatformServiceMixinTest extends Vue {
result: string = "";
userZeroTestResult: any = null;
testInsert() {
const contact = {
@@ -38,5 +50,34 @@ export default class PlatformServiceMixinTest extends Vue {
);
this.result = `SQL: ${sql}\nParams: ${JSON.stringify(params)}`;
}
async testUserZeroSettings() {
try {
// User #0's DID
const userZeroDid = "did:ethr:0x0000694B58C2cC69658993A90D3840C560f2F51F";
this.result = "Testing User #0 settings...";
// Test the debug methods
await this.$debugMergedSettings(userZeroDid);
// Get the actual settings
const didSettings = await this.$debugDidSettings(userZeroDid);
const accountSettings = await this.$accountSettings(userZeroDid);
this.userZeroTestResult = {
didSettings,
accountSettings,
isRegistered: accountSettings.isRegistered,
firstName: accountSettings.firstName,
timestamp: new Date().toISOString(),
};
this.result = `User #0 settings test completed. isRegistered: ${accountSettings.isRegistered}`;
} catch (error) {
this.result = `Error testing User #0 settings: ${error}`;
console.error("Error testing User #0 settings:", error);
}
}
}
</script>