Make comments cache-safe

This commit is contained in:
Jose Farias
2024-10-23 18:58:10 -06:00
parent 208ace7214
commit 8233254de3
8 changed files with 42 additions and 4 deletions
+15
View File
@@ -0,0 +1,15 @@
class Current {
get user() {
const currentUserId = this.#extractContentFromMetaTag("current-user-id")
if (currentUserId) {
return { id: parseInt(currentUserId) }
}
}
#extractContentFromMetaTag(name) {
return document.head.querySelector(`meta[name="${name}"]`)?.getAttribute("content")
}
}
window.Current = new Current()
+1
View File
@@ -0,0 +1 @@
import "initializers/current"