Browse Source

chore: clean up console logs

pull/142/head
Matthew Raymer 20 hours ago
parent
commit
c628c78565
  1. 6
      src/services/platforms/WebPlatformService.ts
  2. 5
      src/utils/PlatformServiceMixin.ts
  3. 6
      src/views/AccountViewView.vue
  4. 10
      src/views/ContactsView.vue
  5. 1
      src/views/DIDView.vue
  6. 2
      src/views/GiftedDetailsView.vue
  7. 4
      src/views/HelpNotificationsView.vue
  8. 6
      src/views/HomeView.vue
  9. 2
      src/views/ImportAccountView.vue
  10. 2
      src/views/ShareMyContactInfoView.vue
  11. 1
      test-playwright/60-new-activity.spec.ts

6
src/services/platforms/WebPlatformService.ts

@ -693,7 +693,11 @@ export class WebPlatformService implements PlatformService {
const setClause = keys.map((key) => `${key} = ?`).join(", "); const setClause = keys.map((key) => `${key} = ?`).join(", ");
const sql = `UPDATE settings SET ${setClause} WHERE accountDid = ?`; const sql = `UPDATE settings SET ${setClause} WHERE accountDid = ?`;
const params = [...keys.map((key) => settings[key]), did]; const params = [...keys.map((key) => settings[key]), did];
console.log("[WebPlatformService] updateDidSpecificSettings", sql, JSON.stringify(params, null, 2)); console.log(
"[WebPlatformService] updateDidSpecificSettings",
sql,
JSON.stringify(params, null, 2),
);
await this.dbExec(sql, params); await this.dbExec(sql, params);
} }

5
src/utils/PlatformServiceMixin.ts

@ -707,7 +707,10 @@ export const PlatformServiceMixin = {
// Merge with any provided defaults (these take highest precedence) // Merge with any provided defaults (these take highest precedence)
const finalSettings = { ...mergedSettings, ...defaults }; const finalSettings = { ...mergedSettings, ...defaults };
console.log("[PlatformServiceMixin] $accountSettings", JSON.stringify(finalSettings, null, 2)); console.log(
"[PlatformServiceMixin] $accountSettings",
JSON.stringify(finalSettings, null, 2),
);
return finalSettings; return finalSettings;
} catch (error) { } catch (error) {
logger.error( logger.error(

6
src/views/AccountViewView.vue

@ -143,9 +143,7 @@
</section> </section>
<PushNotificationPermission ref="pushNotificationPermission" /> <PushNotificationPermission ref="pushNotificationPermission" />
<LocationSearchSection <LocationSearchSection :search-box="searchBox" />
:search-box="searchBox"
/>
<!-- User Profile --> <!-- User Profile -->
<section <section
@ -1369,7 +1367,6 @@ export default class AccountViewView extends Vue {
`Import progress: ${progress.completedRows} of ${progress.totalRows} rows completed.`, `Import progress: ${progress.completedRows} of ${progress.totalRows} rows completed.`,
); );
if (progress.done) { if (progress.done) {
// console.log(`Imported ${progress.completedTables} tables.`);
this.notify.success( this.notify.success(
ACCOUNT_VIEW_CONSTANTS.SUCCESS.IMPORT_COMPLETE, ACCOUNT_VIEW_CONSTANTS.SUCCESS.IMPORT_COMPLETE,
TIMEOUTS.LONG, TIMEOUTS.LONG,
@ -1466,7 +1463,6 @@ export default class AccountViewView extends Vue {
profileImageUrl: imgUrl, profileImageUrl: imgUrl,
}); });
this.profileImageUrl = imgUrl; this.profileImageUrl = imgUrl;
//console.log("Got image URL:", imgUrl);
}, },
IMAGE_TYPE_PROFILE, IMAGE_TYPE_PROFILE,
true, true,

10
src/views/ContactsView.vue

@ -828,19 +828,16 @@ export default class ContactsView extends Vue {
* Handle registration prompt for new contacts * Handle registration prompt for new contacts
*/ */
private async handleRegistrationPrompt(newContact: Contact): Promise<void> { private async handleRegistrationPrompt(newContact: Contact): Promise<void> {
console.log("[ContactsView] handleRegistrationPrompt", this.isRegistered, this.hideRegisterPromptOnNewContact, newContact.registered);
if ( if (
this.isRegistered === false || // the current Identity is not registered OR this.isRegistered === false || // the current Identity is not registered OR
this.hideRegisterPromptOnNewContact === true || // the user has hidden the registrationprompt OR this.hideRegisterPromptOnNewContact === true || // the user has hidden the registrationprompt OR
newContact.registered === true // the new contact is already registered newContact.registered === true // the new contact is already registered
) { ) {
// if any of the above are true, we do not want to show the registration prompt // if any of the above are true, we do not want to show the registration prompt
console.log("[ContactsView] handleRegistrationPrompt we do not want to show the registration prompt");
return; return;
} }
setTimeout(() => { setTimeout(() => {
console.log("[ContactsView] handleRegistrationPrompt setTimeout");
this.$notify( this.$notify(
{ {
group: "modal", group: "modal",
@ -848,22 +845,18 @@ export default class ContactsView extends Vue {
title: "Register", title: "Register",
text: "Do you want to register them?", text: "Do you want to register them?",
onCancel: async (stopAsking?: boolean) => { onCancel: async (stopAsking?: boolean) => {
console.log("[ContactsView] handleRegistrationPrompt onCancel", stopAsking);
await this.handleRegistrationPromptResponse(stopAsking); await this.handleRegistrationPromptResponse(stopAsking);
}, },
onNo: async (stopAsking?: boolean) => { onNo: async (stopAsking?: boolean) => {
console.log("[ContactsView] handleRegistrationPrompt onNo", stopAsking);
await this.handleRegistrationPromptResponse(stopAsking); await this.handleRegistrationPromptResponse(stopAsking);
}, },
onYes: async () => { onYes: async () => {
console.log("[ContactsView] handleRegistrationPrompt onYes");
await this.register(newContact); await this.register(newContact);
}, },
promptToStopAsking: true, promptToStopAsking: true,
}, },
-1, -1,
); );
console.log("[ContactsView] handleRegistrationPrompt setTimeout done");
}, 1000); }, 1000);
} }
@ -1254,17 +1247,14 @@ export default class ContactsView extends Vue {
*/ */
public handleQRCodeClick() { public handleQRCodeClick() {
console.log("[ContactsView] handleQRCodeClick method called");
this.$logAndConsole( this.$logAndConsole(
"[ContactsView] handleQRCodeClick method called", "[ContactsView] handleQRCodeClick method called",
false, false,
); );
if (Capacitor.isNativePlatform()) { if (Capacitor.isNativePlatform()) {
console.log("[ContactsView] Navigating to contact-qr-scan-full");
this.$router.push({ name: "contact-qr-scan-full" }); this.$router.push({ name: "contact-qr-scan-full" });
} else { } else {
console.log("[ContactsView] Navigating to contact-qr");
this.$router.push({ name: "contact-qr" }); this.$router.push({ name: "contact-qr" });
} }
} }

1
src/views/DIDView.vue

@ -758,7 +758,6 @@ export default class DIDView extends Vue {
if (resp.status === 200) { if (resp.status === 200) {
const visibility = resp.data; const visibility = resp.data;
contact.seesMe = visibility; contact.seesMe = visibility;
//console.log("Visi check:", visibility, contact.seesMe, contact.did);
await this.$updateContact(contact.did, { seesMe: visibility }); await this.$updateContact(contact.did, { seesMe: visibility });
const message = const message =

2
src/views/GiftedDetailsView.vue

@ -490,7 +490,6 @@ export default class GiftedDetails extends Vue {
this.showGeneralAdvanced = !!settings.showGeneralAdvanced; this.showGeneralAdvanced = !!settings.showGeneralAdvanced;
if (this.fulfillsProjectId) { if (this.fulfillsProjectId) {
// console.log("Getting project name from cache", this.fulfillsProjectId);
const fulfillsProject = await getPlanFromCache( const fulfillsProject = await getPlanFromCache(
this.fulfillsProjectId, this.fulfillsProjectId,
this.axios, this.axios,
@ -502,7 +501,6 @@ export default class GiftedDetails extends Vue {
: "a project"; : "a project";
} }
if (this.providerProjectId) { if (this.providerProjectId) {
// console.log("Getting project name from cache", this.providerProjectId);
const providerProject = await getPlanFromCache( const providerProject = await getPlanFromCache(
this.providerProjectId, this.providerProjectId,
this.axios, this.axios,

4
src/views/HelpNotificationsView.vue

@ -454,10 +454,6 @@ export default class HelpNotificationsView extends Vue {
* Useful for troubleshooting push notification issues and verifying subscription status. * Useful for troubleshooting push notification issues and verifying subscription status.
*/ */
alertWebPushSubscription() { alertWebPushSubscription() {
// console.log(
// "Web push subscription:",
// JSON.parse(JSON.stringify(this.subscriptionJSON)), // gives more info than plain console logging
// );
alert(JSON.stringify(this.subscriptionJSON)); alert(JSON.stringify(this.subscriptionJSON));
} }

6
src/views/HomeView.vue

@ -9,7 +9,11 @@ Raymer * @version 1.0.0 */
<TopMessage /> <TopMessage />
<!-- CONTENT --> <!-- CONTENT -->
<section id="Content" class="p-6 pb-24 max-w-3xl mx-auto" :data-active-did="activeDid"> <section
id="Content"
class="p-6 pb-24 max-w-3xl mx-auto"
:data-active-did="activeDid"
>
<h1 id="ViewHeading" class="text-4xl text-center font-light mb-8"> <h1 id="ViewHeading" class="text-4xl text-center font-light mb-8">
{{ AppString.APP_NAME }} {{ AppString.APP_NAME }}
<span class="text-xs text-gray-500">{{ package.version }}</span> <span class="text-xs text-gray-500">{{ package.version }}</span>

2
src/views/ImportAccountView.vue

@ -189,7 +189,6 @@ export default class ImportAccountView extends Vue {
* Uses importFromMnemonic utility for secure import * Uses importFromMnemonic utility for secure import
*/ */
public async onImportClick() { public async onImportClick() {
console.log("[ImportAccountView] onImportClick", this.mnemonic);
if (!this.mnemonic?.trim()) { if (!this.mnemonic?.trim()) {
this.notify.warning( this.notify.warning(
"Seed phrase is required to import an account.", "Seed phrase is required to import an account.",
@ -207,7 +206,6 @@ export default class ImportAccountView extends Vue {
// Check what was actually imported // Check what was actually imported
const settings = await this.$accountSettings(); const settings = await this.$accountSettings();
console.log("[ImportAccountView] settings", JSON.stringify(settings, null, 2));
// Check account-specific settings // Check account-specific settings
if (settings?.activeDid) { if (settings?.activeDid) {

2
src/views/ShareMyContactInfoView.vue

@ -82,10 +82,8 @@ export default class ShareMyContactInfoView extends Vue {
// @ts-expect-error - Debug property for testing contact sharing functionality // @ts-expect-error - Debug property for testing contact sharing functionality
window.__SHARE_CONTACT_DEBUG__ = { settings, activeDid }; window.__SHARE_CONTACT_DEBUG__ = { settings, activeDid };
// eslint-disable-next-line no-console // eslint-disable-next-line no-console
console.log("[ShareMyContactInfoView] mounted", { settings, activeDid });
if (!activeDid) { if (!activeDid) {
// eslint-disable-next-line no-console // eslint-disable-next-line no-console
console.log("[ShareMyContactInfoView] No activeDid, redirecting to root");
this.$router.push({ name: "home" }); this.$router.push({ name: "home" });
} }
} }

1
test-playwright/60-new-activity.spec.ts

@ -7,7 +7,6 @@ test('New offers for another user', async ({ page }) => {
// Get the auto-created DID from the HomeView // Get the auto-created DID from the HomeView
await page.waitForLoadState('networkidle'); await page.waitForLoadState('networkidle');
const autoCreatedDid = await page.getAttribute('#Content', 'data-active-did'); const autoCreatedDid = await page.getAttribute('#Content', 'data-active-did');
console.log("[New offers for another user] Auto-created DID:", autoCreatedDid);
if (!autoCreatedDid) { if (!autoCreatedDid) {
throw new Error('Auto-created DID not found in HomeView'); throw new Error('Auto-created DID not found in HomeView');

Loading…
Cancel
Save