diff --git a/src/lib/utils/Logger.ts b/src/lib/utils/Logger.ts index 945811718..a47af8667 100644 --- a/src/lib/utils/Logger.ts +++ b/src/lib/utils/Logger.ts @@ -50,8 +50,12 @@ export class Logger { console.warn(`[${level.toString()}] (${new Date().toLocaleTimeString()}): ${message}`, ...other) break } + case LogLevel.Info: { + console.info(`\x1b[32mℹ️ [${level.toString()}] (${new Date().toLocaleTimeString()}): ${message}\x1b[0m`, ...other) + break + } default: { - console.log(`[${level.toString()}] (${new Date().toLocaleTimeString()}): ${message}`, ...other) + console.log(`\x1b[36m🔍 [${level.toString()}] (${new Date().toLocaleTimeString()}): ${message}\x1b[0m`, ...other) break } } diff --git a/src/lib/wasm/MultipassStore.ts b/src/lib/wasm/MultipassStore.ts index 2ac4d19c0..e24a2463b 100644 --- a/src/lib/wasm/MultipassStore.ts +++ b/src/lib/wasm/MultipassStore.ts @@ -208,7 +208,10 @@ class MultipassStore { outgoingFriendRequestsUsers ) } catch (error) { - log.error("Error listing incoming friend requests: " + error) + let messageError: string = `${error}` + if (messageError !== "Error: MultiPass extension is unavailable") { + log.error("Error listing outgoing friend requests: " + error) + } } } } @@ -336,7 +339,10 @@ class MultipassStore { get(Store.state.activeRequests).filter(r => r.direction === MessageDirection.Outbound) ) } catch (error) { - log.error("Error listing incoming friend requests: " + error) + let messageError: string = `${error}` + if (messageError !== "Error: MultiPass extension is unavailable") { + log.error("Error listing incoming friend requests: " + error) + } } } } @@ -361,7 +367,10 @@ class MultipassStore { } Store.setBlockedUsers(blockedUsers) } catch (error) { - log.error("Error listing blocked friends: " + error) + let messageError: string = `${error}` + if (messageError !== "Error: MultiPass extension is unavailable") { + log.error("Error listing blocked friends: " + error) + } } } } @@ -386,7 +395,10 @@ class MultipassStore { } Store.setFriends(friendsUsers) } catch (error) { - log.error("Error listing friends: " + error) + let messageError: string = `${error}` + if (messageError !== "Error: MultiPass extension is unavailable") { + log.error("Error listing friends: " + error) + } } } } @@ -653,7 +665,8 @@ class MultipassStore { } } } - if (lastErr) { + let lastErrStr = `${lastErr}` + if (lastErr && lastErrStr !== "Error: Identity does not exist") { log.error(`Couldn't fetch identity ${id}: ${lastErr}`) } return undefined