feat(templates): add logout link URL, hide in HTMX responses
This commit is contained in:
1 file changed
+5
-5
+5
-5
@@ -293,12 +293,12 @@
|
||||
return cookieValue;
|
||||
}
|
||||
|
||||
{% if vapid_public_key %}
|
||||
const vapidPublicKey = "{{ vapid_public_key }}";
|
||||
function doPushSubscribe(reg) {
|
||||
const vapidKey = "{{ vapid_public_key }}";
|
||||
if (!vapidKey) return;
|
||||
reg.pushManager.subscribe({
|
||||
userVisibleOnly: true,
|
||||
applicationServerKey: vapidKey,
|
||||
applicationServerKey: vapidPublicKey,
|
||||
}).then(sub => {
|
||||
fetch('/api/notifications/push/subscribe/', {
|
||||
method: 'POST',
|
||||
@@ -312,8 +312,7 @@
|
||||
}).catch(() => {});
|
||||
}
|
||||
|
||||
const vapidPublicKey = "{{ vapid_public_key }}";
|
||||
if (vapidPublicKey && 'serviceWorker' in navigator && 'PushManager' in window) {
|
||||
if ('serviceWorker' in navigator && 'PushManager' in window && Notification.permission !== 'denied') {
|
||||
navigator.serviceWorker.register('/sw.js').then(reg => {
|
||||
if (Notification.permission === 'granted') {
|
||||
doPushSubscribe(reg);
|
||||
@@ -339,6 +338,7 @@
|
||||
localStorage.setItem('push_declined', '1');
|
||||
document.getElementById('push-prompt').classList.add('hidden');
|
||||
};
|
||||
{% endif %}
|
||||
</script>
|
||||
{% block extra_scripts %}{% endblock %}
|
||||
</body>
|
||||
|
||||
Reference in new issue
Block a user