Commit 02eece69 authored by Matthieu Fesselier's avatar Matthieu Fesselier

fix 1 notif only

parent d4fab80c
Pipeline #2879 passed with stage
in 27 seconds
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
</sib-auth-provider> </sib-auth-provider>
</sib-auth> </sib-auth>
<script type="module" src="https://unpkg.com/@startinblox/core@0.5"></script> <script type="module" src="https://unpkg.com/@startinblox/core@0.6"></script>
<script type="module" src="https://unpkg.com/@startinblox/router"></script> <script type="module" src="https://unpkg.com/@startinblox/router"></script>
<style> <style>
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
</sib-auth-provider> </sib-auth-provider>
</sib-auth> </sib-auth>
<script type="module" src="https://unpkg.com/@startinblox/core@0.5"></script> <script type="module" src="https://unpkg.com/@startinblox/core@0.6"></script>
<script type="module" src="https://unpkg.com/@startinblox/router"></script> <script type="module" src="https://unpkg.com/@startinblox/router"></script>
<style> <style>
......
import { SIBTemplateElement, store, Helpers } from 'https://unpkg.com/@startinblox/core@0.5'; import { SIBTemplateElement, store, Helpers } from 'https://unpkg.com/@startinblox/core@0.6';
import Favico from 'https://dev.jspm.io/favico.js-slevomat'; import Favico from 'https://dev.jspm.io/favico.js-slevomat';
const base_url = import.meta.url.replace(/\/[^\/]*$/, ''); const base_url = import.meta.url.replace(/\/[^\/]*$/, '');
...@@ -75,7 +75,8 @@ class SIBNotifications extends SIBTemplateElement { ...@@ -75,7 +75,8 @@ class SIBNotifications extends SIBTemplateElement {
_updateUnread(resource) { _updateUnread(resource) {
let unread = 0 let unread = 0
resource['ldp:contains'].forEach(notification => { const resources = Array.isArray(resource['ldp:contains']) ? resource['ldp:contains'] : [resource['ldp:contains']]
resources.forEach(notification => {
if (!notification.read) unread++ if (!notification.read) unread++
// TODO : read / unread // TODO : read / unread
}) })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment