Merge pull request #1032 from PR0M3TH3AN/codex/fix-comment-display-in-video-player-modal

Normalize comment tree root keys before rendering
This commit is contained in:
thePR0M3TH3AN authored and GitHub committed 2025-11-04 15:07:55 -05:00
commit ed2ac76edc
2 files changed
+23 -2

No files matched your search

+6 -1
View File
@@ -1815,7 +1815,12 @@ export class VideoModal {
}
if (typeof value === "string") {
const trimmed = value.trim();
if (!trimmed || trimmed === "null" || trimmed === "undefined") {
if (
!trimmed ||
trimmed === "null" ||
trimmed === "undefined" ||
trimmed === "__root__"
) {
return null;
}
return trimmed;
+17 -1
View File
@@ -458,8 +458,24 @@ export default class VideoModalCommentController {
input instanceof Map ? input : this.createMapFromInput(input);
const result = new Map();
source.forEach((value, key) => {
let normalizedKey = key;
if (normalizedKey === null || normalizedKey === undefined) {
normalizedKey = null;
} else if (typeof normalizedKey === "string") {
const trimmed = normalizedKey.trim();
if (
!trimmed ||
trimmed === "null" ||
trimmed === "undefined" ||
trimmed === "__root__"
) {
normalizedKey = null;
} else {
normalizedKey = trimmed;
}
}
const list = Array.isArray(value) ? value.filter(Boolean) : [];
result.set(key, list);
result.set(normalizedKey, list);
});
return result;
}