Gate watch history v2 behind runtime flag

This commit is contained in:
thePR0M3TH3AN committed 2025-10-02 15:19:55 -04:00
1 parent b4f7ed1e54
commit 6cfaf38ce1
5 files changed
+148 -5

No files matched your search

+10 -1
View File
@@ -7585,7 +7585,16 @@ class bitvidApp {
(async () => {
let viewResult;
try {
viewResult = await watchHistoryService.publishView(thresholdPointer);
const watchHistoryEnabled =
watchHistoryService?.isEnabled?.() === true &&
typeof watchHistoryService.publishView === "function";
if (watchHistoryEnabled) {
viewResult = await watchHistoryService.publishView(thresholdPointer);
} else if (typeof nostrClient?.recordVideoView === "function") {
viewResult = await nostrClient.recordVideoView(thresholdPointer);
} else {
viewResult = { ok: false, error: "view-logging-unavailable" };
}
} catch (error) {
if (isDevMode) {
console.warn(