refactor: Replace console logging with logger utility

- Add logger import across multiple view components
- Replace console.error/warn/log with logger methods
- Update error handling to use structured logging
- Improve type safety for error objects
- Add crypto-browserify polyfill for browser environment

The changes improve logging by:
1. Using consistent logging interface
2. Adding structured error logging
3. Improving error type safety
4. Centralizing logging configuration
5. Fixing browser compatibility issues

Affected files:
- Multiple view components
- vite.config.ts
- Build configuration
This commit is contained in:
Matthew Raymer
2025-03-11 09:35:55 +00:00
parent 515bb38db4
commit c9536dd643
1781 changed files with 81616 additions and 401 deletions

View File

@@ -976,6 +976,7 @@ import {
retrieveAccountMetadata,
} from "../libs/util";
import { UserProfile } from "@/libs/partnerServer";
import { logger } from "../utils/logger";
const inputImportFileNameRef = ref<Blob>();
@@ -1109,12 +1110,12 @@ export default class AccountViewView extends Vue {
}
} catch (error) {
// this can happen when running automated tests in dev mode because notifications don't work
console.error(
logger.error(
"Telling user to clear cache at page create because:",
error,
);
// this sometimes gives different information on the error
console.error(
logger.error(
"To repeat with concatenated error: telling user to clear cache at page create because: " +
error,
);
@@ -1521,7 +1522,7 @@ export default class AccountViewView extends Vue {
* @param {Error} error - The error object.
*/
private handleExportError(error: unknown) {
console.error("Export Error:", error);
logger.error("Export Error:", error);
this.$notify(
{
group: "alert",
@@ -1591,7 +1592,7 @@ export default class AccountViewView extends Vue {
query: { contacts: JSON.stringify(contactRows) },
});
} catch (error) {
console.error("Error checking contact imports:", error);
logger.error("Error checking contact imports:", error);
this.$notify(
{
group: "alert",
@@ -1607,7 +1608,7 @@ export default class AccountViewView extends Vue {
}
private progressCallback(progress: ImportProgress) {
console.log(
logger.log(
`Import progress: ${progress.completedRows} of ${progress.totalRows} rows completed.`,
);
if (progress.done) {
@@ -1659,7 +1660,7 @@ export default class AccountViewView extends Vue {
await updateAccountSettings(did, { isRegistered: true });
this.isRegistered = true;
} catch (err) {
console.error("Got an error updating settings:", err);
logger.error("Got an error updating settings:", err);
this.$notify(
{
group: "alert",
@@ -1698,7 +1699,7 @@ export default class AccountViewView extends Vue {
if (error instanceof AxiosError) {
if (error.status == 400 || error.status == 404) {
// no worries: they probably just aren't registered and don't have any limits
console.log(
logger.log(
"Got 400 or 404 response retrieving limits which probably means they're not registered:",
error,
);
@@ -1707,11 +1708,11 @@ export default class AccountViewView extends Vue {
const data = error.response?.data as ErrorResponse;
this.limitsMessage =
(data?.error?.message as string) || "Bad server response.";
console.error("Got bad response retrieving limits:", error);
logger.error("Got bad response retrieving limits:", error);
}
} else {
this.limitsMessage = "Got an error retrieving limits.";
console.error("Got some error retrieving limits:", error);
logger.error("Got some error retrieving limits:", error);
}
}
@@ -1788,7 +1789,7 @@ export default class AccountViewView extends Vue {
window.location.hostname === "localhost" &&
!DEFAULT_IMAGE_API_SERVER.includes("localhost")
) {
console.log(
logger.log(
"Using shared image API server, so only users on that server can play with images.",
);
}
@@ -1802,7 +1803,7 @@ export default class AccountViewView extends Vue {
// don't bother with a notification
// (either they'll simply continue or they're canceling and going back)
} else {
console.error("Non-success deleting image:", response);
logger.error("Non-success deleting image:", response);
this.$notify(
{
group: "alert",
@@ -1822,10 +1823,10 @@ export default class AccountViewView extends Vue {
this.profileImageUrl = undefined;
} catch (error) {
console.error("Error deleting image:", error);
logger.error("Error deleting image:", error);
// eslint-disable-next-line @typescript-eslint/no-explicit-any
if ((error as any).response.status === 404) {
console.error("The image was already deleted:", error);
logger.error("The image was already deleted:", error);
await updateAccountSettings(this.activeDid, {
profileImageUrl: undefined,

View File

@@ -39,6 +39,7 @@ import * as serverUtil from "../libs/endorserServer";
import * as libsUtil from "../libs/util";
import { errorStringForLog } from "../libs/endorserServer";
import { Router, RouteLocationNormalizedLoaded } from "vue-router";
import { logger } from "../utils/logger";
/**
* View component for adding or editing raw claim data
@@ -141,7 +142,7 @@ export default class ClaimAddRawView extends Vue {
/**
* Format successful claim response data
*/
private formatClaimResponse(response: any, claimJwtId: string) {
private formatClaimResponse(response: unknown, claimJwtId: string) {
if (response.status === 200) {
const claim = response.data?.claim;
claim.lastClaimId = serverUtil.stripEndorserPrefix(claimJwtId);
@@ -203,7 +204,7 @@ export default class ClaimAddRawView extends Vue {
5000,
);
} else {
console.error("Got error submitting the claim:", result);
logger.error("Got error submitting the claim:", result);
this.$notify(
{
group: "alert",

View File

@@ -18,6 +18,7 @@ import { APP_SERVER, NotificationIface } from "../constants/app";
import { db, retrieveSettingsForActiveAccount } from "../db/index";
import * as serverUtil from "../libs/endorserServer";
import { GenericCredWrapper, GenericVerifiableCredential } from "../interfaces";
import { logger } from "../utils/logger";
@Component
export default class ClaimCertificateView extends Vue {
$notify!: (notification: NotificationIface, timeout?: number) => void;
@@ -69,7 +70,7 @@ export default class ClaimCertificateView extends Vue {
throw new Error(`Error fetching claim: ${response.statusText}`);
}
} catch (error) {
console.error("Failed to load claim:", error);
logger.error("Failed to load claim:", error);
this.$notify({
group: "alert",
type: "danger",

View File

@@ -14,7 +14,7 @@ import QRCode from "qrcode";
import { APP_SERVER, NotificationIface } from "../constants/app";
import { db, retrieveSettingsForActiveAccount } from "../db/index";
import * as endorserServer from "../libs/endorserServer";
import { logger } from "../utils/logger";
@Component
export default class ClaimReportCertificateView extends Vue {
$notify!: (notification: NotificationIface, timeout?: number) => void;
@@ -53,7 +53,7 @@ export default class ClaimReportCertificateView extends Vue {
throw new Error(`Error fetching claim: ${response.statusText}`);
}
} catch (error) {
console.error("Failed to load claim:", error);
logger.error("Failed to load claim:", error);
this.$notify({
group: "alert",
type: "danger",

View File

@@ -366,7 +366,9 @@
</div>
</div>
<!-- Note that a similar section is found in ConfirmGiftView.vue, and kinda in HiddenDidDialog.vue -->
<!--
Note that a similar section is found in ConfirmGiftView.vue, and kinda in HiddenDidDialog.vue
-->
<h2
class="font-bold uppercase text-xl text-blue-500 mt-8 cursor-pointer"
@click="showVeriClaimDump = !showVeriClaimDump"
@@ -554,6 +556,7 @@ import {
ProviderInfo,
} from "../interfaces";
import * as libsUtil from "../libs/util";
import { logger } from "../utils/logger";
@Component({
components: { GiftedDialog, QuickNav },
@@ -617,7 +620,7 @@ export default class ClaimView extends Vue {
}
async created() {
console.log("ClaimView created");
logger.log("ClaimView created");
const settings = await retrieveSettingsForActiveAccount();
this.activeDid = settings.activeDid || "";
this.apiServer = settings.apiServer || "";
@@ -687,7 +690,7 @@ export default class ClaimView extends Vue {
}
async loadClaim(claimId: string, userDid: string) {
console.log("[ClaimView] loadClaim called with claimId:", claimId);
logger.log("[ClaimView] loadClaim called with claimId:", claimId);
const urlPath = libsUtil.isGlobalUri(claimId)
? "/api/claim/byHandle/"
: "/api/claim/";
@@ -695,7 +698,7 @@ export default class ClaimView extends Vue {
const headers = await serverUtil.getHeaders(userDid);
try {
console.log("[ClaimView] Making API request to:", url);
logger.log("[ClaimView] Making API request to:", url);
const resp = await this.axios.get(url, { headers });
if (resp.status === 200) {
this.veriClaim = resp.data;
@@ -707,7 +710,7 @@ export default class ClaimView extends Vue {
);
} else {
// actually, axios typically throws an error so we never get here
console.error("Error getting claim:", resp);
logger.error("Error getting claim:", resp);
this.$notify(
{
group: "alert",
@@ -735,7 +738,7 @@ export default class ClaimView extends Vue {
if (giveResp.status === 200 && giveResp.data.data?.length > 0) {
this.detailsForGive = giveResp.data.data[0];
} else {
console.error("Error getting detailed give info:", giveResp);
logger.error("Error getting detailed give info:", giveResp);
}
// look for providers
@@ -754,7 +757,7 @@ export default class ClaimView extends Vue {
) {
this.providersForGive = providerResp.data.data;
} else {
console.error("Error getting give providers:", giveResp);
logger.error("Error getting give providers:", giveResp);
this.$notify(
{
group: "alert",
@@ -777,7 +780,7 @@ export default class ClaimView extends Vue {
if (offerResp.status === 200) {
this.detailsForOffer = offerResp.data.data[0];
} else {
console.error("Error getting detailed offer info:", offerResp);
logger.error("Error getting detailed offer info:", offerResp);
this.$notify(
{
group: "alert",
@@ -807,7 +810,7 @@ export default class ClaimView extends Vue {
}
} catch (error: unknown) {
const serverError = error as AxiosError;
console.error("Error retrieving claim:", serverError);
logger.error("Error retrieving claim:", serverError);
this.$notify(
{
group: "alert",
@@ -832,7 +835,7 @@ export default class ClaimView extends Vue {
this.fullClaimDump = yaml.dump(this.fullClaim);
} else {
// actually, axios typically throws an error so we never get here
console.error("Error getting full claim:", resp);
logger.error("Error getting full claim:", resp);
this.$notify(
{
group: "alert",
@@ -844,7 +847,7 @@ export default class ClaimView extends Vue {
);
}
} catch (error: unknown) {
console.error("Error retrieving full claim:", error);
logger.error("Error retrieving full claim:", error);
const serverError = error as AxiosError;
if (serverError.response?.status === 403) {
let issuerPhrase = "";
@@ -939,7 +942,7 @@ export default class ClaimView extends Vue {
5000,
);
} else {
console.error("Got error submitting the confirmation:", result);
logger.error("Got error submitting the confirmation:", result);
this.$notify(
{
group: "alert",
@@ -1029,7 +1032,7 @@ export default class ClaimView extends Vue {
};
(this.$router as Router).push(route);
} else {
console.error(
logger.error(
"Unrecognized claim type for edit:",
this.veriClaim.claimType,
);

View File

@@ -275,7 +275,9 @@
</div>
</div>
<!-- Note that a similar section is found in ClaimView.vue, and kinda in HiddenDidDialog.vue -->
<!--
Note that a similar section is found in ClaimView.vue, and kinda in HiddenDidDialog.vue
-->
<h2
class="font-bold uppercase text-xl text-blue-500 mt-8 cursor-pointer"
@click="showVeriClaimDump = !showVeriClaimDump"
@@ -445,7 +447,7 @@ import { displayAmount } from "../libs/endorserServer";
import * as libsUtil from "../libs/util";
import { retrieveAccountDids } from "../libs/util";
import TopMessage from "../components/TopMessage.vue";
import { logger } from "../utils/logger";
/**
* ConfirmGiftView Component
*
@@ -515,7 +517,7 @@ export default class ConfirmGiftView extends Vue {
await this.initializeSettings();
await this.loadClaimFromUrl();
} catch (error) {
console.error("Error in mounted:", error);
logger.error("Error in mounted:", error);
this.handleMountError(error);
} finally {
this.isLoading = false;
@@ -610,7 +612,7 @@ export default class ConfirmGiftView extends Vue {
throw new Error("Error getting claim: " + resp.status);
}
} catch (error) {
console.error("Error getting claim:", error);
logger.error("Error getting claim:", error);
throw new Error("There was a problem retrieving that claim.");
}
}
@@ -631,7 +633,7 @@ export default class ConfirmGiftView extends Vue {
throw new Error("Error getting detailed give info: " + resp.status);
}
} catch (error) {
console.error("Error getting detailed give info:", error);
logger.error("Error getting detailed give info:", error);
throw new Error("Something went wrong retrieving gift data.");
}
}

View File

@@ -132,7 +132,7 @@ import {
SCHEMA_ORG_CONTEXT,
} from "../libs/endorserServer";
import { retrieveAccountCount } from "../libs/util";
import { logger } from "../utils/logger";
@Component({ components: { QuickNav } })
export default class ContactAmountssView extends Vue {
$notify!: (notification: NotificationIface, timeout?: number) => void;
@@ -165,7 +165,7 @@ export default class ContactAmountssView extends Vue {
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
} catch (err: any) {
console.error("Error retrieving settings or gives.", err);
logger.error("Error retrieving settings or gives.", err);
this.$notify(
{
group: "alert",
@@ -194,7 +194,7 @@ export default class ContactAmountssView extends Vue {
if (resp.status === 200) {
result = resp.data.data;
} else {
console.error(
logger.error(
"Got bad response status & data of",
resp.status,
resp.data,
@@ -221,7 +221,7 @@ export default class ContactAmountssView extends Vue {
if (resp2.status === 200) {
result = R.concat(result, resp2.data.data);
} else {
console.error(
logger.error(
"Got bad response status & data of",
resp2.status,
resp2.data,

View File

@@ -80,7 +80,7 @@ import { NotificationIface } from "../constants/app";
import { db, retrieveSettingsForActiveAccount } from "../db/index";
import { Contact } from "../db/tables/contacts";
import { GiverReceiverInputInfo } from "../libs/util";
import { logger } from "../utils/logger";
@Component({
components: { GiftedDialog, QuickNav, EntityIcon },
})
@@ -114,7 +114,7 @@ export default class ContactGiftingView extends Vue {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
} catch (err: any) {
console.error("Error retrieving settings & contacts:", err);
logger.error("Error retrieving settings & contacts:", err);
this.$notify(
{
group: "alert",

View File

@@ -109,7 +109,7 @@ import {
import { decodeEndorserJwt, ETHR_DID_PREFIX } from "../libs/crypto/vc";
import { retrieveAccountMetadata } from "../libs/util";
import { Router } from "vue-router";
import { logger } from "../utils/logger";
@Component({
components: {
QrcodeStream,
@@ -210,7 +210,7 @@ export default class ContactQRScanShow extends Vue {
return;
}
} catch (e) {
console.error("Error parsing QR info:", e);
logger.error("Error parsing QR info:", e);
this.danger("Could not parse the QR info.", "Read Error");
return;
}
@@ -274,7 +274,7 @@ export default class ContactQRScanShow extends Vue {
}
}
} catch (e) {
console.error("Error saving contact info:", e);
logger.error("Error saving contact info:", e);
this.$notify(
{
group: "alert",
@@ -310,7 +310,7 @@ export default class ContactQRScanShow extends Vue {
if (result.error) {
this.danger(result.error as string, "Error Setting Visibility");
} else if (!result.success) {
console.error("Got strange result from setting visibility:", result);
logger.error("Got strange result from setting visibility:", result);
}
}
@@ -360,7 +360,7 @@ export default class ContactQRScanShow extends Vue {
);
}
} catch (error) {
console.error("Error when registering:", error);
logger.error("Error when registering:", error);
let userMessage = "There was an error.";
const serverError = error as AxiosError;
if (serverError) {
@@ -389,7 +389,7 @@ export default class ContactQRScanShow extends Vue {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
onScanError(error: any) {
console.error("Scan was invalid:", error);
logger.error("Scan was invalid:", error);
this.$notify(
{
group: "alert",

View File

@@ -392,7 +392,7 @@ import {
} from "../libs/endorserServer";
import * as libsUtil from "../libs/util";
import { generateSaveAndActivateIdentity } from "../libs/util";
import { logger } from "../utils/logger";
@Component({
components: {
GiftedDialog,
@@ -683,7 +683,7 @@ export default class ContactsView extends Vue {
}
}
} else {
console.error(
logger.error(
"Got bad response status & data of",
resp.status,
resp.data,
@@ -1161,7 +1161,7 @@ export default class ContactsView extends Vue {
}
return true;
} else {
console.error(
logger.error(
"Got strange result from setting visibility. It can happen when setting visibility on oneself.",
result,
);

View File

@@ -252,6 +252,7 @@ import {
} from "../libs/endorserServer";
import * as libsUtil from "../libs/util";
import EntityIcon from "../components/EntityIcon.vue";
import { logger } from "../utils/logger";
/**
* DIDView Component
@@ -517,7 +518,7 @@ export default class DIDView extends Vue {
);
}
} catch (error) {
console.error("Error when registering:", error);
logger.error("Error when registering:", error);
let userMessage = "There was an error.";
const serverError = error as AxiosError;
if (serverError) {
@@ -551,7 +552,7 @@ export default class DIDView extends Vue {
*/
public async loadClaimsAbout() {
if (!this.viewingDid) {
console.error("This should never be called without a DID.");
logger.error("This should never be called without a DID.");
return;
}
@@ -573,7 +574,7 @@ export default class DIDView extends Vue {
if (response.status !== 200) {
const details = await response.text();
console.error("Problem with full search:", details);
logger.error("Problem with full search:", details);
this.$notify(
{
group: "alert",
@@ -592,7 +593,7 @@ export default class DIDView extends Vue {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
} catch (e: any) {
console.error("Error with feed load:", e);
logger.error("Error with feed load:", e);
this.$notify(
{
group: "alert",
@@ -733,7 +734,7 @@ export default class DIDView extends Vue {
}
return true;
} else {
console.error("Got strange result from setting visibility:", result);
logger.error("Got strange result from setting visibility:", result);
const message =
(result.error as string) || "Could not set visibility on the server.";
this.$notify(
@@ -796,7 +797,7 @@ export default class DIDView extends Vue {
3000,
);
} else {
console.error("Got bad server response checking visibility:", resp);
logger.error("Got bad server response checking visibility:", resp);
const message = resp.data.error?.message || "Got bad server response.";
this.$notify(
{
@@ -809,7 +810,7 @@ export default class DIDView extends Vue {
);
}
} catch (err) {
console.error("Caught error from request to check visibility:", err);
logger.error("Caught error from request to check visibility:", err);
this.$notify(
{
group: "alert",

View File

@@ -191,7 +191,10 @@
<p class="text-lg text-slate-500">
<span v-if="isLocalActive">
<span v-if="searchBox"> None found in the selected area. </span>
<!-- Otherwise there's no search area selected so we'll just leave the search box for them to click. -->
<!--
Otherwise there's no search area selected so we'll just leave the search box for them
to click.
-->
</span>
<span v-else-if="isAnywhereActive"
>No projects were found with that search.</span
@@ -329,7 +332,7 @@ import {
getHeaders,
} from "../libs/endorserServer";
import { OnboardPage, retrieveAccountDids } from "../libs/util";
import { logger } from "../utils/logger";
interface Tile {
indexLat: number;
indexLon: number;
@@ -502,9 +505,9 @@ export default class DiscoverView extends Vue {
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
} catch (e: any) {
console.error("Error with search all:", e);
logger.error("Error with search all:", e);
// this sometimes gives different information
console.error("Error with search all (error added): " + e);
logger.error("Error with search all (error added): " + e);
this.$notify(
{
group: "alert",
@@ -596,7 +599,7 @@ export default class DiscoverView extends Vue {
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
} catch (e: any) {
console.error("Error with search local:", e);
logger.error("Error with search local:", e);
this.$notify(
{
group: "alert",

View File

@@ -279,6 +279,7 @@ import {
} from "../libs/endorserServer";
import * as libsUtil from "../libs/util";
import { retrieveAccountDids } from "../libs/util";
import { logger } from "../utils/logger";
@Component({
components: {
@@ -549,7 +550,7 @@ export default class GiftedDetails extends Vue {
window.location.hostname === "localhost" &&
!DEFAULT_IMAGE_API_SERVER.includes("localhost")
) {
console.log(
logger.log(
"Using shared image API server, so only users on that server can play with images.",
);
}
@@ -563,7 +564,7 @@ export default class GiftedDetails extends Vue {
// don't bother with a notification
// (either they'll simply continue or they're canceling and going back)
} else {
console.error("Problem deleting image:", response);
logger.error("Problem deleting image:", response);
this.$notify(
{
group: "alert",
@@ -580,10 +581,10 @@ export default class GiftedDetails extends Vue {
localStorage.removeItem("imageUrl");
this.imageUrl = "";
} catch (error) {
console.error("Error deleting image:", error);
logger.error("Error deleting image:", error);
// eslint-disable-next-line @typescript-eslint/no-explicit-any
if ((error as any).response.status === 404) {
console.log("Weird: the image was already deleted.", error);
logger.log("Weird: the image was already deleted.", error);
localStorage.removeItem("imageUrl");
this.imageUrl = "";
@@ -816,7 +817,7 @@ export default class GiftedDetails extends Vue {
this.isGiveCreationError(result.response)
) {
const errorMessage = this.getGiveCreationErrorMessage(result);
console.error("Error with give creation result:", result);
logger.error("Error with give creation result:", result);
this.$notify(
{
group: "alert",
@@ -845,7 +846,7 @@ export default class GiftedDetails extends Vue {
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
} catch (error: any) {
console.error("Error with give recordation caught:", error);
logger.error("Error with give recordation caught:", error);
const errorMessage =
error.userMessage ||
error.response?.data?.error?.message ||

View File

@@ -42,16 +42,21 @@
<h2 class="text-xl font-semibold mt-4">New Activity Notifications</h2>
<div>
<p>
The New Activity Notification will be sent to you when there is new, relevant activity for you.
The New Activity Notification will be sent to you when there is new, relevant activity
for you.
It will only trigger if something involves you or a project of interest; it will not
bug you for other, general activity.
</p>
<p>
This type is not as reliable as a Reminder Notification because mobile devices often suppress
such notifications to save battery. (If you want to quickly check for relevant activity daily,
use the Reminder Notification and open the app and look for a large green button that points out new
activity that is personal to you. We are working on other ways to notify you more
reliably -- <router-link class="text-blue-500" to="/help">go here to follow us or contact us</router-link>.)
This type is not as reliable as a Reminder Notification because mobile devices often
suppress such notifications to save battery. (If you want to quickly check for relevant
activity daily, use the Reminder Notification and open the app and look for a large green
button that points out new activity that is personal to you. We are working on other
ways to notify you more reliably.
<router-link class="text-blue-500" to="/help">
go here to follow us or contact us
<font-awesome icon="chevron-right" class="fa-fw"></font-awesome>
</router-link>.)
</p>
</div>
</div>

View File

@@ -314,7 +314,7 @@ import PushNotificationPermission from "../components/PushNotificationPermission
import { db } from "../db/index";
import { MASTER_SETTINGS_KEY } from "../db/tables/settings";
import { Router } from "vue-router";
import { logger } from "../utils/logger";
@Component({ components: { PushNotificationPermission, QuickNav } })
export default class HelpNotificationsView extends Vue {
$notify!: (notification: NotificationIface, timeout?: number) => void;
@@ -327,7 +327,7 @@ export default class HelpNotificationsView extends Vue {
const fullSub = await registration?.pushManager.getSubscription();
this.subscriptionJSON = fullSub?.toJSON();
} catch (error) {
console.error("Mount error:", error);
logger.error("Mount error:", error);
}
}
@@ -369,7 +369,7 @@ export default class HelpNotificationsView extends Vue {
5000,
);
} catch (error) {
console.error("Got an error sending test notification:", error);
logger.error("Got an error sending test notification:", error);
this.$notify(
{
group: "alert",
@@ -402,7 +402,7 @@ export default class HelpNotificationsView extends Vue {
);
})
.catch((error) => {
console.error("Got a notification error:", error);
logger.error("Got a notification error:", error);
this.$notify(
{
group: "alert",

View File

@@ -98,7 +98,8 @@
<p>
Enable notifications from the Account page <font-awesome icon="circle-user" />.
Those notifications might show up on the device depending on your settings.
For the most reliable habits, set an alarm or do some other ritual to record gratitude every day.
For the most reliable habits, set an alarm or do some other ritual to record gratitude
every day.
</p>
</div>

View File

@@ -10,7 +10,10 @@
<OnboardingDialog ref="onboardingDialog" />
<!-- prompt to install notifications with notificationsSupported, which we're making an advanced feature -->
<!--
prompt to install notifications with notificationsSupported, which we're making an advanced
feature
-->
<div class="mb-8 mt-8">
<div
v-if="false"
@@ -76,7 +79,9 @@
<div v-else>
<!-- !isCreatingIdentifier -->
<!-- They should have an identifier, even if it's an auto-generated one that they'll never use. -->
<!--
They should have an identifier, even if it's an auto-generated one that they'll never use.
-->
<div class="mb-4">
<div
v-if="!isRegistered"
@@ -278,39 +283,6 @@
</span>
</span>
<span class="col-span-10 justify-self-stretch overflow-hidden">
<!-- show giver and/or receiver profiles... which seemed like a good idea but actually adds clutter
<span
v-if="
record.giver.profileImageUrl ||
record.receiver.profileImageUrl
"
>
<EntityIcon
v-if="record.agentDid !== activeDid"
:icon-size="32"
:profile-image-url="record.giver.profileImageUrl"
class="inline-block align-middle border border-slate-300 rounded-md mr-1"
/>
<font-awesome
v-if="
record.agentDid !== activeDid &&
record.recipientDid !== activeDid &&
!record.fulfillsPlanHandleId
"
icon="ellipsis"
class="text-slate"
/>
<EntityIcon
v-if="
record.recipientDid !== activeDid &&
!record.fulfillsPlanHandleId
"
:iconSize="32"
:profile-image-url="record.receiver.profileImageUrl"
class="inline-block align-middle border border-slate-300 rounded-md ml-1"
/>
</span>
-->
<span class="pl-2 block break-words">
{{ giveDescription(record) }}
</span>
@@ -447,7 +419,7 @@ interface GiveRecordWithContactInfo extends GiveSummaryRecord {
profileImageUrl?: string;
};
}
import { logger } from "../utils/logger";
/**
* HomeView - Main view component for the application's home page
*
@@ -530,7 +502,7 @@ export default class HomeView extends Vue {
await this.loadFeedData();
await this.loadNewOffers();
await this.checkOnboarding();
} catch (err: any) {
} catch (err: unknown) {
this.handleError(err);
}
}
@@ -675,7 +647,7 @@ export default class HomeView extends Vue {
* - Displays user notification
* @param err Error object with optional userMessage
*/
private handleError(err: any) {
private handleError(err: unknown) {
logConsoleAndDb("Error retrieving settings or feed: " + err, true);
this.$notify(
{
@@ -857,7 +829,7 @@ export default class HomeView extends Vue {
}
})
.catch((e) => {
console.error("Error with feed load:", e);
logger.error("Error with feed load:", e);
this.$notify(
{
group: "alert",
@@ -1098,7 +1070,7 @@ export default class HomeView extends Vue {
// The Web Share API will handle sharing the URL appropriately
this.imageCache.set(imageUrl, null);
} catch (error) {
console.warn("Failed to cache image:", error);
logger.warn("Failed to cache image:", error);
}
}

View File

@@ -113,7 +113,7 @@ import {
} from "../db/index";
import { MASTER_SETTINGS_KEY } from "../db/tables/settings";
import { retrieveAllAccountsMetadata } from "../libs/util";
import { logger } from "../utils/logger";
@Component({ components: { QuickNav } })
export default class IdentitySwitcherView extends Vue {
$notify!: (notification: NotificationIface, timeout?: number) => void;
@@ -153,7 +153,7 @@ export default class IdentitySwitcherView extends Vue {
},
5000,
);
console.error("Telling user to clear cache at page create because:", err);
logger.error("Telling user to clear cache at page create because:", err);
}
}

View File

@@ -99,7 +99,7 @@ import {
newIdentifier,
} from "../libs/crypto";
import { retrieveAccountCount } from "../libs/util";
import { logger } from "../utils/logger";
@Component({
components: {},
})
@@ -174,7 +174,7 @@ export default class ImportAccountView extends Vue {
this.$router.push({ name: "account" });
// eslint-disable-next-line @typescript-eslint/no-explicit-any
} catch (err: any) {
console.error("Error saving mnemonic & updating settings:", err);
logger.error("Error saving mnemonic & updating settings:", err);
if (err == "Error: invalid mnemonic") {
this.$notify(
{

View File

@@ -81,7 +81,7 @@ import {
import { accountsDBPromise, db } from "../db/index";
import { MASTER_SETTINGS_KEY } from "../db/tables/settings";
import { retrieveAllFullyDecryptedAccounts } from "../libs/util";
import { logger } from "../utils/logger";
@Component({
components: {},
})
@@ -156,7 +156,7 @@ export default class ImportAccountView extends Vue {
});
this.$router.push({ name: "account" });
} catch (err) {
console.error("Error saving mnemonic & updating settings:", err);
logger.error("Error saving mnemonic & updating settings:", err);
}
}
}

View File

@@ -142,7 +142,7 @@ import { APP_SERVER, AppString, NotificationIface } from "../constants/app";
import { db, retrieveSettingsForActiveAccount } from "../db/index";
import { Contact } from "../db/tables/contacts";
import { createInviteJwt, getHeaders } from "../libs/endorserServer";
import { logger } from "../utils/logger";
interface Invite {
inviteIdentifier: string;
expiresAt: string;
@@ -191,7 +191,7 @@ export default class InviteOneView extends Vue {
}
}
} catch (error) {
console.error("Error fetching invites:", error);
logger.error("Error fetching invites:", error);
this.$notify(
{
group: "alert",
@@ -258,7 +258,7 @@ export default class InviteOneView extends Vue {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
lookForErrorAndNotify(error: any, title: string, defaultMessage: string) {
console.error(title, "-", error);
logger.error(title, "-", error);
let message = defaultMessage;
if (error.response && error.response.data && error.response.data.error) {
if (error.response.data.error.message) {

View File

@@ -224,7 +224,7 @@ export default class NewActivityView extends Vue {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
} catch (err: any) {
console.error("Error retrieving settings & contacts:", err);
logger.error("Error retrieving settings & contacts:", err);
this.$notify(
{
group: "alert",

View File

@@ -187,13 +187,6 @@
@click.stop="showNostrPartnerInfo"
/>
</div>
<!--
<div class="flex" @click="sendToTripHopping = !sendToTripHopping">
<input type="checkbox" class="mr-2" v-model="sendToTripHopping" />
<label>Send to TripHopping</label>
<font-awesome icon="circle-info" class="text-blue-500 ml-2 cursor-pointer" @click.stop="showNostrPartnerInfo" />
</div>
-->
</div>
<div class="mt-8">
@@ -261,7 +254,7 @@ import {
VerifiedEvent,
} from "nostr-tools/lib/esm/index.js";
import { serializeEvent } from "nostr-tools/lib/esm/index.js";
import { logger } from "../utils/logger";
@Component({
components: { ImageMethodDialog, LMap, LMarker, LTileLayer, QuickNav },
})
@@ -364,7 +357,7 @@ export default class NewEditProjectView extends Vue {
}
}
} catch (error) {
console.error("Got error retrieving that project", error);
logger.error("Got error retrieving that project", error);
this.errNote("There was an error retrieving that project.");
}
}
@@ -398,7 +391,7 @@ export default class NewEditProjectView extends Vue {
window.location.hostname === "localhost" &&
!DEFAULT_IMAGE_API_SERVER.includes("localhost")
) {
console.log(
logger.log(
"Using shared image API server, so only users on that server can play with images.",
);
}
@@ -412,7 +405,7 @@ export default class NewEditProjectView extends Vue {
// don't bother with a notification
// (either they'll simply continue or they're canceling and going back)
} else {
console.error("Problem deleting image:", response);
logger.error("Problem deleting image:", response);
this.$notify(
{
group: "alert",
@@ -427,10 +420,10 @@ export default class NewEditProjectView extends Vue {
this.imageUrl = "";
} catch (error) {
console.error("Error deleting image:", error);
logger.error("Error deleting image:", error);
// eslint-disable-next-line @typescript-eslint/no-explicit-any
if ((error as any).response.status === 404) {
console.log("The image was already deleted:", error);
logger.log("The image was already deleted:", error);
this.imageUrl = "";
@@ -602,10 +595,7 @@ export default class NewEditProjectView extends Vue {
this.$router.push({ path: "/project/" + projectPath });
} else {
console.error(
"Got unexpected 'data' inside response from server",
resp,
);
logger.error("Got unexpected 'data' inside response from server", resp);
this.$notify(
{
group: "alert",
@@ -622,7 +612,7 @@ export default class NewEditProjectView extends Vue {
error?: { message?: string };
}>;
if (serverError) {
console.error("Got error from server", serverError);
logger.error("Got error from server", serverError);
if (Object.prototype.hasOwnProperty.call(serverError, "message")) {
userMessage =
(serverError.response?.data?.error?.message as string) ||
@@ -648,7 +638,7 @@ export default class NewEditProjectView extends Vue {
);
}
} else {
console.error("Here's the full error trying to save the claim:", error);
logger.error("Here's the full error trying to save the claim:", error);
this.$notify(
{
group: "alert",
@@ -768,7 +758,7 @@ export default class NewEditProjectView extends Vue {
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
} catch (error: any) {
console.error(`Error sending to ${serviceName}`, error);
logger.error(`Error sending to ${serviceName}`, error);
let errorMessage = `There was an error sending to ${serviceName}.`;
if (error.response?.data?.error?.message) {
errorMessage = error.response.data.error.message;
@@ -790,7 +780,7 @@ export default class NewEditProjectView extends Vue {
this.isHiddenSpinner = false;
if (this.numAccounts === 0) {
console.error("Error: there is no account.");
logger.error("Error: there is no account.");
} else {
this.saveProject();
}

View File

@@ -192,7 +192,7 @@ import {
} from "../libs/endorserServer";
import * as libsUtil from "../libs/util";
import { retrieveAccountDids } from "../libs/util";
import { logger } from "../utils/logger";
/**
* Offer Details View Component
* @author Matthew Raymer
@@ -303,8 +303,8 @@ export default class OfferDetailsView extends Vue {
await this.loadAccountSettings();
await this.loadRecipientInfo();
await this.loadProjectInfo();
} catch (err: any) {
console.error("Error in mounted:", err);
} catch (err: unknown) {
logger.error("Error in mounted:", err);
this.$notify(
{
group: "alert",
@@ -328,7 +328,7 @@ export default class OfferDetailsView extends Vue {
this.$route.query["prevCredToEdit"] as string,
) as GenericCredWrapper<OfferVerifiableCredential>)
: undefined;
} catch (error) {
} catch (error: unknown) {
this.$notify(
{
group: "alert",
@@ -687,7 +687,7 @@ export default class OfferDetailsView extends Vue {
if (result.type === "error" || this.isCreationError(result.response)) {
const errorMessage = this.getCreationErrorMessage(result);
console.error("Error with offer creation result:", result);
logger.error("Error with offer creation result:", result);
this.$notify(
{
group: "alert",
@@ -716,7 +716,7 @@ export default class OfferDetailsView extends Vue {
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
} catch (error: any) {
console.error("Error with offer recordation caught:", error);
logger.error("Error with offer recordation caught:", error);
const errorMessage =
error.userMessage ||
error.response?.data?.error?.message ||

View File

@@ -99,7 +99,10 @@
<h2 class="text-2xl mb-4">
{{ isInCreateMode() ? "Create New Meeting" : "Edit Meeting" }}
</h2>
<!-- This is my first form. Not sure if I like it; will see if the browser benefits extend to the native app. -->
<!--
This is my first form. Not sure if I like it; will see if the browser benefits extend to
the native app.
-->
<form
class="space-y-4"
@submit.prevent="isInCreateMode() ? createMeeting() : updateMeeting()"
@@ -236,7 +239,7 @@ import {
serverMessageForUser,
} from "../libs/endorserServer";
import { encryptMessage } from "../libs/crypto";
import { logger } from "../utils/logger";
interface ServerMeeting {
groupId: number; // from the server
name: string; // from the server
@@ -512,7 +515,7 @@ export default class OnboardMeetingView extends Vue {
3000,
);
} catch (error) {
console.error("Error deleting meeting:", error);
logger.error("Error deleting meeting:", error);
this.$notify(
{
group: "alert",
@@ -538,7 +541,7 @@ export default class OnboardMeetingView extends Vue {
password: this.currentMeeting.password || "",
};
} else {
console.error(
logger.error(
"There is no current meeting to edit. We should never get here.",
);
}

View File

@@ -159,7 +159,10 @@
<h3 class="text-sm uppercase font-semibold mt-3">
Projects That Contribute To This
</h3>
<!-- centering because long, wrapped project names didn't left align with blank or "text-left" -->
<!--
centering because long, wrapped project names didn't left align with blank
or "text-left"
-->
<div class="text-center">
<div v-for="plan in fulfillersToThis" :key="plan.handleId">
<button
@@ -181,7 +184,10 @@
<h3 class="text-sm uppercase font-semibold mb-3">
Projects Getting Contributions From This
</h3>
<!-- centering because long, wrapped project names didn't left align with blank or "text-left" -->
<!--
centering because long, wrapped project names didn't left align with blank
or "text-left"
-->
<div class="text-center">
<button
class="text-blue-500"
@@ -372,8 +378,8 @@
<span class="font-semibold mr-2 shrink-0">Totals</span>
<span class="whitespace-nowrap overflow-hidden text-ellipsis">
<a
@click="totalsExpanded = !totalsExpanded"
class="cursor-pointer text-blue-500"
@click="totalsExpanded = !totalsExpanded"
>
<!-- just show the hours, or alternatively whatever is first -->
<span v-if="givenTotalHours() > 0">
@@ -623,7 +629,7 @@ import * as libsUtil from "../libs/util";
import * as serverUtil from "../libs/endorserServer";
import { retrieveAccountDids } from "../libs/util";
import HiddenDidDialog from "../components/HiddenDidDialog.vue";
import { logger } from "../utils/logger";
/**
* Project View Component
* @author Matthew Raymer
@@ -702,6 +708,7 @@ export default class ProjectViewView extends Vue {
fulfillersToThis: Array<PlanSummaryRecord> = [];
/** Flag for fulfiller pagination */
fulfillersToHitLimit = false;
/** Gifts to this project */
givesToThis: Array<GiveSummaryRecord> = [];
givesHitLimit = false;
givesProvidedByThis: Array<GiveSummaryRecord> = [];
@@ -733,14 +740,6 @@ export default class ProjectViewView extends Vue {
// Interaction Data
/** Gifts to this project */
givesToThis: Array<GiveSummaryRecord> = [];
/** Flag for gifts pagination */
givesHitLimit = false;
/** Gifts from this project */
givesProvidedByThis: Array<GiveSummaryRecord> = [];
/** Flag for provided gifts pagination */
givesProvidedByHitLimit = false;
/** Offers to this project */
offersToThis: Array<OfferSummaryRecord> = [];
/** Flag for offers pagination */
offersHitLimit = false;
@@ -750,7 +749,7 @@ export default class ProjectViewView extends Vue {
checkingConfirmationForJwtId = "";
/** Recently checked unconfirmable JWTs */
recentlyCheckedAndUnconfirmableJwts: string[] = [];
startTime = "";
totalsExpanded = false;
truncatedDesc = "";
/** Truncation length */
@@ -806,12 +805,14 @@ export default class ProjectViewView extends Vue {
this.loadTotals();
}
onEditClick() {
const route = {
/**
* Navigates to project edit view with current project ID
*/
onEditClick(): void {
this.$router.push({
name: "new-edit-project",
query: { projectId: this.projectId },
};
(this.$router as Router).push(route);
});
}
// Isn't there a better way to make this available to the template?
@@ -869,7 +870,7 @@ export default class ProjectViewView extends Vue {
this.url = resp.data.claim?.url || "";
} else {
// actually, axios throws an error on 404 so we probably never get here
console.error("Error getting project:", resp);
logger.error("Error getting project:", resp);
this.$notify(
{
group: "alert",
@@ -881,7 +882,7 @@ export default class ProjectViewView extends Vue {
);
}
} catch (error: unknown) {
console.error("Error retrieving project:", error);
logger.error("Error retrieving project:", error);
this.$notify(
{
group: "alert",
@@ -958,7 +959,7 @@ export default class ProjectViewView extends Vue {
},
5000,
);
console.error(
logger.error(
"Something went wrong retrieving more gives to this project:",
serverError.message,
);
@@ -1017,7 +1018,7 @@ export default class ProjectViewView extends Vue {
},
5000,
);
console.error(
logger.error(
"Something went wrong retrieving gives that were provided by this project:",
serverError.message,
);
@@ -1073,7 +1074,7 @@ export default class ProjectViewView extends Vue {
},
5000,
);
console.error(
logger.error(
"Something went wrong retrieving more offers to this project:",
serverError.message,
);
@@ -1129,7 +1130,7 @@ export default class ProjectViewView extends Vue {
},
5000,
);
console.error(
logger.error(
"Something went wrong retrieving more plans that fulfill this project:",
serverError.message,
);
@@ -1176,30 +1177,13 @@ export default class ProjectViewView extends Vue {
},
5000,
);
console.error(
logger.error(
"Error retrieving plans fulfilled by this project:",
serverError.message,
);
}
}
onEditClick() {
const route = {
name: "new-edit-project",
query: { projectId: this.projectId },
};
this.$router.push(route);
}
// Isn't there a better way to make this available to the template?
expandText() {
this.expanded = true;
}
collapseText() {
this.expanded = false;
}
/**
* Handle clicking on a project entry found in the list
* @param id of the project
@@ -1437,7 +1421,7 @@ export default class ProjectViewView extends Vue {
give.jwtId,
];
} else {
console.error("Got error submitting the confirmation:", result);
logger.error("Got error submitting the confirmation:", result);
const message =
(result.error?.error as string) ||
"There was a problem submitting the confirmation.";
@@ -1493,7 +1477,7 @@ export default class ProjectViewView extends Vue {
);
}
} catch (error) {
console.error("Error loading totals:", error);
logger.error("Error loading totals:", error);
this.$notify(
{
group: "alert",

View File

@@ -159,7 +159,8 @@
>
<!--
There's no need for a green icon:
it's unnecessary if there's already a green, and confusing if there's a yellow.
it's unnecessary if there's already a green, and confusing if there's a
yellow.
-->
all
</span>
@@ -287,7 +288,7 @@ import {
} from "../libs/endorserServer";
import * as libsUtil from "../libs/util";
import { OnboardPage } from "../libs/util";
import { logger } from "../utils/logger";
@Component({
components: {
EntityIcon,
@@ -345,13 +346,13 @@ export default class ProjectsView extends Vue {
}
if (this.allMyDids.length === 0) {
console.error("No accounts found.");
logger.error("No accounts found.");
this.errNote("You need an identifier to load your projects.");
} else {
await this.loadProjects();
}
} catch (err) {
console.error("Error initializing:", err);
logger.error("Error initializing:", err);
this.errNote("Something went wrong loading your projects.");
}
}
@@ -380,7 +381,7 @@ export default class ProjectsView extends Vue {
});
}
} else {
console.error(
logger.error(
"Bad server response & data for plans:",
resp.status,
resp.data,
@@ -389,7 +390,7 @@ export default class ProjectsView extends Vue {
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
} catch (error: any) {
console.error("Got error loading plans:", error.message || error);
logger.error("Got error loading plans:", error.message || error);
this.errNote("Got an error loading projects.");
} finally {
this.isLoading = false;
@@ -473,7 +474,7 @@ export default class ProjectsView extends Vue {
this.offers = this.offers.concat([offer]);
}
} else {
console.error(
logger.error(
"Bad server response & data for offers:",
resp.status,
resp.data,
@@ -490,7 +491,7 @@ export default class ProjectsView extends Vue {
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
} catch (error: any) {
console.error("Got error loading offers:", error.message || error);
logger.error("Got error loading offers:", error.message || error);
this.$notify(
{
group: "alert",

View File

@@ -81,7 +81,7 @@ import {
createAndSubmitGive,
} from "../libs/endorserServer";
import * as libsUtil from "../libs/util";
import { logger } from "../utils/logger";
@Component({
components: {
QuickNav,
@@ -143,7 +143,7 @@ export default class QuickActionBvcBeginView extends Vue {
if (timeResult.type === "success") {
timeSuccess = true;
} else {
console.error("Error sending time:", timeResult);
logger.error("Error sending time:", timeResult);
this.$notify(
{
group: "alert",
@@ -170,7 +170,7 @@ export default class QuickActionBvcBeginView extends Vue {
if (attendResult.type === "success") {
attendedSuccess = true;
} else {
console.error("Error sending attendance:", attendResult);
logger.error("Error sending attendance:", attendResult);
this.$notify(
{
group: "alert",
@@ -206,7 +206,7 @@ export default class QuickActionBvcBeginView extends Vue {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
} catch (error: any) {
console.error("Error sending claims.", error);
logger.error("Error sending claims.", error);
this.$notify(
{
group: "alert",

View File

@@ -164,7 +164,7 @@ import {
createAndSubmitGive,
getHeaders,
} from "../libs/endorserServer";
import { logger } from "../utils/logger";
@Component({
methods: { claimSpecialDescription },
components: {
@@ -229,7 +229,7 @@ export default class QuickActionBvcBeginView extends Vue {
);
if (!response.ok) {
console.error("Bad response", response);
logger.error("Bad response", response);
throw new Error("Bad response when retrieving claims.");
}
await response.json().then((data) => {
@@ -248,7 +248,7 @@ export default class QuickActionBvcBeginView extends Vue {
dataByOthers.length - dataByOthersWithoutHidden.length;
});
} catch (error) {
console.error("Error:", error);
logger.error("Error:", error);
this.$notify(
{
group: "alert",
@@ -300,7 +300,7 @@ export default class QuickActionBvcBeginView extends Vue {
result.status === "fulfilled" && result.value.type === "success",
);
if (confirmsSucceeded.length < this.claimsToConfirmSelected.length) {
console.error("Error sending confirmations:", confirmResults);
logger.error("Error sending confirmations:", confirmResults);
const howMany = confirmsSucceeded.length === 0 ? "all" : "some";
this.$notify(
{
@@ -333,7 +333,7 @@ export default class QuickActionBvcBeginView extends Vue {
);
giveSucceeded = giveResult.type === "success";
if (!giveSucceeded) {
console.error("Error sending give:", giveResult);
logger.error("Error sending give:", giveResult);
this.$notify(
{
group: "alert",
@@ -405,7 +405,7 @@ export default class QuickActionBvcBeginView extends Vue {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
} catch (error: any) {
console.error("Error sending claims.", error);
logger.error("Error sending claims.", error);
this.$notify(
{
group: "alert",

View File

@@ -94,7 +94,7 @@ import {
getNewOffersToUserProjects,
} from "../libs/endorserServer";
import { retrieveAccountDids } from "../libs/util";
import { logger } from "../utils/logger";
@Component({
components: { EntityIcon, GiftedDialog, InfiniteScroll, QuickNav },
})
@@ -138,7 +138,7 @@ export default class RecentOffersToUserView extends Vue {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
} catch (err: any) {
console.error("Error retrieving settings & contacts:", err);
logger.error("Error retrieving settings & contacts:", err);
this.$notify(
{
group: "alert",

View File

@@ -86,7 +86,7 @@ import {
getNewOffersToUser,
} from "../libs/endorserServer";
import { retrieveAccountDids } from "../libs/util";
import { logger } from "../utils/logger";
@Component({
components: { EntityIcon, GiftedDialog, InfiniteScroll, QuickNav },
})
@@ -129,7 +129,7 @@ export default class RecentOffersToUserView extends Vue {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
} catch (err: any) {
console.error("Error retrieving settings & contacts:", err);
logger.error("Error retrieving settings & contacts:", err);
this.$notify(
{
group: "alert",

View File

@@ -115,7 +115,7 @@ import QuickNav from "../components/QuickNav.vue";
import { NotificationIface } from "../constants/app";
import { db, retrieveSettingsForActiveAccount } from "../db/index";
import { BoundingBox, MASTER_SETTINGS_KEY } from "../db/tables/settings";
import { logger } from "../utils/logger";
const DEFAULT_LAT_LONG_DIFF = 0.01;
const WORLD_ZOOM = 2;
const DEFAULT_ZOOM = 2;
@@ -231,7 +231,7 @@ export default class SearchAreaView extends Vue {
},
5000,
);
console.error(
logger.error(
"Telling user to retry the location search setting because:",
err,
);
@@ -274,7 +274,7 @@ export default class SearchAreaView extends Vue {
},
5000,
);
console.error(
logger.error(
"Telling user to retry the location search setting because:",
err,
);

View File

@@ -117,6 +117,7 @@ import {
retrieveFullyDecryptedAccount,
} from "../libs/util";
import { Router } from "vue-router";
import { logger } from "../utils/logger";
@Component({ components: { QuickNav } })
export default class SeedBackupView extends Vue {
$notify!: (notification: NotificationIface, timeout?: number) => void;
@@ -136,7 +137,7 @@ export default class SeedBackupView extends Vue {
this.numAccounts = await retrieveAccountCount();
this.activeAccount = await retrieveFullyDecryptedAccount(activeDid);
} catch (err: unknown) {
console.error("Got an error loading an identifier:", err);
logger.error("Got an error loading an identifier:", err);
this.$notify(
{
group: "alert",

View File

@@ -50,7 +50,7 @@ import { NotificationIface, APP_SERVER } from "../constants/app";
import { db, retrieveSettingsForActiveAccount } from "../db/index";
import { retrieveAccountMetadata } from "../libs/util";
import { generateEndorserJwtUrlForAccount } from "../libs/endorserServer";
import { logger } from "../utils/logger";
@Component({
components: { QuickNav, TopMessage },
})
@@ -59,7 +59,7 @@ export default class ShareMyContactInfoView extends Vue {
$router!: Router;
mounted() {
console.log("APP_SERVER in mounted:", APP_SERVER);
logger.log("APP_SERVER in mounted:", APP_SERVER);
}
async onClickShare() {

View File

@@ -83,7 +83,7 @@ import { db, retrieveSettingsForActiveAccount } from "../db/index";
import { MASTER_SETTINGS_KEY } from "../db/tables/settings";
import { accessToken } from "../libs/crypto";
import { base64ToBlob, SHARED_PHOTO_BASE64_KEY } from "../libs/util";
import { logger } from "../utils/logger";
@Component({ components: { PhotoDialog, QuickNav } })
export default class SharedPhotoView extends Vue {
$notify!: (notification: NotificationIface, timeout?: number) => void;
@@ -113,10 +113,10 @@ export default class SharedPhotoView extends Vue {
this.imageFileName = this.$route.query["fileName"] as string;
} else {
console.error("No appropriate image found in temp storage.", temp);
logger.error("No appropriate image found in temp storage.", temp);
}
} catch (err: unknown) {
console.error("Got an error loading an identifier:", err);
logger.error("Got an error loading an identifier:", err);
this.$notify(
{
group: "alert",
@@ -191,7 +191,7 @@ export default class SharedPhotoView extends Vue {
window.location.hostname === "localhost" &&
!DEFAULT_IMAGE_API_SERVER.includes("localhost")
) {
console.log(
logger.log(
"Using shared image API server, so only users on that server can play with images.",
);
}
@@ -205,7 +205,7 @@ export default class SharedPhotoView extends Vue {
this.imageFileName = undefined;
result = response.data.url as string;
} else {
console.error("Problem uploading the image", response.data);
logger.error("Problem uploading the image", response.data);
this.$notify(
{
group: "alert",
@@ -221,7 +221,7 @@ export default class SharedPhotoView extends Vue {
this.uploading = false;
} catch (error) {
console.error("Error uploading the image", error);
logger.error("Error uploading the image", error);
this.$notify(
{
group: "alert",

View File

@@ -285,7 +285,7 @@ import {
registerAndSavePasskey,
SHARED_PHOTO_BASE64_KEY,
} from "../libs/util";
import { logger } from "../utils/logger";
const inputFileNameRef = ref<Blob>();
const TEST_PAYLOAD = {
@@ -411,7 +411,7 @@ export default class Help extends Vue {
TEST_PAYLOAD,
this.credIdHex as string,
);
console.log("simple jwt4url", this.jwt);
logger.log("simple jwt4url", this.jwt);
}
public async createJwtNavigator() {
@@ -428,7 +428,7 @@ export default class Help extends Vue {
TEST_PAYLOAD,
this.credIdHex as string,
);
console.log("lower jwt4url", this.jwt);
logger.log("lower jwt4url", this.jwt);
}
public async verifyP256() {
@@ -440,7 +440,7 @@ export default class Help extends Vue {
this.peerSetup?.clientDataJsonBase64Url as Base64URLString,
this.peerSetup?.signature as Base64URLString,
);
console.log("decoded", decoded);
logger.log("decoded", decoded);
}
public async verifySimplewebauthn() {
@@ -452,7 +452,7 @@ export default class Help extends Vue {
this.peerSetup?.clientDataJsonBase64Url as Base64URLString,
this.peerSetup?.signature as Base64URLString,
);
console.log("decoded", decoded);
logger.log("decoded", decoded);
}
public async verifyWebCrypto() {
@@ -464,7 +464,7 @@ export default class Help extends Vue {
this.peerSetup?.clientDataJsonBase64Url as Base64URLString,
this.peerSetup?.signature as Base64URLString,
);
console.log("decoded", decoded);
logger.log("decoded", decoded);
}
public async verifyMyJwt() {
@@ -490,7 +490,7 @@ export default class Help extends Vue {
payload["ClientDataJSONB64URL"],
signatureB64URL,
);
console.log("decoded", decoded);
logger.log("decoded", decoded);
}
}
</script>

View File

@@ -108,7 +108,7 @@ import { Contact } from "../db/tables/contacts";
import { didInfo, getHeaders } from "../libs/endorserServer";
import { UserProfile } from "../libs/partnerServer";
import { retrieveAccountDids } from "../libs/util";
import { logger } from "../utils/logger";
@Component({
components: {
LMap,
@@ -169,7 +169,7 @@ export default class UserProfileView extends Vue {
throw new Error("Failed to load profile");
}
} catch (error) {
console.error("Error loading profile:", error);
logger.error("Error loading profile:", error);
this.$notify(
{
group: "alert",