mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-27 07:52:24 +00:00
fix(logs): suppress dm sync spam and allow local image paths
This commit is contained in:
1 parent
b24aac7349
commit
5ed5554f51
3 files changed
+14
-5
No files matched your search
@@ -392,7 +392,7 @@ export default class ApplicationBootstrap {
|
||||
app.loginModalController = null;
|
||||
app.currentUserNpub = null;
|
||||
|
||||
app.initializeLoginModalController({ logIfMissing: true });
|
||||
app.initializeLoginModalController({ logIfMissing: false });
|
||||
|
||||
app.profileButton = doc?.getElementById("profileButton") || null;
|
||||
app.profileAvatar = doc?.getElementById("profileAvatar") || null;
|
||||
|
||||
@@ -1124,6 +1124,7 @@ export class ProfileModalController {
|
||||
this.directMessagesUnsubscribes = [];
|
||||
this.pendingMessagesRender = null;
|
||||
this.messagesStatusClearTimeout = null;
|
||||
this.lastDirectMessageErrorTime = 0;
|
||||
|
||||
this.profileHistoryRenderer = null;
|
||||
this.profileHistoryRendererConfig = null;
|
||||
@@ -2417,10 +2418,14 @@ export class ProfileModalController {
|
||||
|
||||
handleDirectMessagesError(detail = {}) {
|
||||
const error = detail?.error || detail?.failure || detail;
|
||||
userLogger.warn(
|
||||
"[profileModal] Direct message sync issue detected:",
|
||||
error,
|
||||
);
|
||||
const now = Date.now();
|
||||
if (now - this.lastDirectMessageErrorTime > 5000) {
|
||||
userLogger.warn(
|
||||
"[profileModal] Direct message sync issue detected:",
|
||||
error,
|
||||
);
|
||||
this.lastDirectMessageErrorTime = now;
|
||||
}
|
||||
|
||||
if (this.activeMessagesRequest) {
|
||||
return;
|
||||
|
||||
@@ -62,6 +62,10 @@ export function sanitizeProfileMediaUrl(value) {
|
||||
return trimmed;
|
||||
}
|
||||
|
||||
if (/^images\//i.test(trimmed)) {
|
||||
return trimmed;
|
||||
}
|
||||
|
||||
if (!/^https?:\/\//i.test(trimmed)) {
|
||||
if (LOCALHOST_PATTERN.test(trimmed)) {
|
||||
trimmed = `http://${trimmed}`;
|
||||
|
||||
Reference in new issue
Block a user