diff --git a/package-lock.json b/package-lock.json
index 482af7ef4..9579d9c06 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -12,7 +12,7 @@
"@babel/runtime": "7.16.0",
"@sentry/browser": "6.13.3",
"@stremio/stremio-colors": "5.0.1",
- "@stremio/stremio-core-web": "0.44.20",
+ "@stremio/stremio-core-web": "0.44.21",
"@stremio/stremio-icons": "4.0.0",
"@stremio/stremio-video": "0.0.24",
"a-color-picker": "1.2.1",
@@ -2703,9 +2703,9 @@
"integrity": "sha512-Dt3PYmy1DZ473QNs99KYXVWQPHtpIl37VUY0+gCEvvuCqE1fRrZIJtZ9KbysUKonvO7WwdQDztgcW0iGoc1dEA=="
},
"node_modules/@stremio/stremio-core-web": {
- "version": "0.44.20",
- "resolved": "https://registry.npmjs.org/@stremio/stremio-core-web/-/stremio-core-web-0.44.20.tgz",
- "integrity": "sha512-dcqs9svqe9iQHDIyIr7ML42H5Oa2GNjIy3Ngp/TSMPd0UIQ/kJ4ZU/qoZk17r/McI20FEzYIdGFdCcif7c/n9g==",
+ "version": "0.44.21",
+ "resolved": "https://registry.npmjs.org/@stremio/stremio-core-web/-/stremio-core-web-0.44.21.tgz",
+ "integrity": "sha512-xVCE9A/ZWLJ8un1x6VYSDY4fYclxq4rV98UIgUcc9SZlleHOoB92kqy5TIXhQ6v+Ym9EX9OU2uLBv+d2fi6KHA==",
"dependencies": {
"@babel/runtime": "7.16.0"
}
@@ -16804,9 +16804,9 @@
"integrity": "sha512-Dt3PYmy1DZ473QNs99KYXVWQPHtpIl37VUY0+gCEvvuCqE1fRrZIJtZ9KbysUKonvO7WwdQDztgcW0iGoc1dEA=="
},
"@stremio/stremio-core-web": {
- "version": "0.44.20",
- "resolved": "https://registry.npmjs.org/@stremio/stremio-core-web/-/stremio-core-web-0.44.20.tgz",
- "integrity": "sha512-dcqs9svqe9iQHDIyIr7ML42H5Oa2GNjIy3Ngp/TSMPd0UIQ/kJ4ZU/qoZk17r/McI20FEzYIdGFdCcif7c/n9g==",
+ "version": "0.44.21",
+ "resolved": "https://registry.npmjs.org/@stremio/stremio-core-web/-/stremio-core-web-0.44.21.tgz",
+ "integrity": "sha512-xVCE9A/ZWLJ8un1x6VYSDY4fYclxq4rV98UIgUcc9SZlleHOoB92kqy5TIXhQ6v+Ym9EX9OU2uLBv+d2fi6KHA==",
"requires": {
"@babel/runtime": "7.16.0"
}
diff --git a/package.json b/package.json
index 0f3efc6c6..dfa055820 100755
--- a/package.json
+++ b/package.json
@@ -15,7 +15,7 @@
"@babel/runtime": "7.16.0",
"@sentry/browser": "6.13.3",
"@stremio/stremio-colors": "5.0.1",
- "@stremio/stremio-core-web": "0.44.20",
+ "@stremio/stremio-core-web": "0.44.21",
"@stremio/stremio-icons": "4.0.0",
"@stremio/stremio-video": "0.0.24",
"a-color-picker": "1.2.1",
diff --git a/src/App/App.js b/src/App/App.js
index f0752dc3f..be59767b7 100644
--- a/src/App/App.js
+++ b/src/App/App.js
@@ -129,6 +129,12 @@ const App = () => {
action: 'SyncLibraryWithAPI'
}
});
+ services.core.transport.dispatch({
+ action: 'Ctx',
+ args: {
+ action: 'PullNotifications'
+ }
+ });
};
if (services.core.active) {
onWindowFocus();
diff --git a/src/common/LibItem/LibItem.js b/src/common/LibItem/LibItem.js
index 8cc174266..431359071 100644
--- a/src/common/LibItem/LibItem.js
+++ b/src/common/LibItem/LibItem.js
@@ -4,6 +4,7 @@ const React = require('react');
const { useServices } = require('stremio/services');
const PropTypes = require('prop-types');
const MetaItem = require('stremio/common/MetaItem');
+const useNotifications = require('stremio/common/useNotifications');
const { t } = require('i18next');
const OPTIONS = [
@@ -15,6 +16,11 @@ const OPTIONS = [
const LibItem = ({ _id, removable, ...props }) => {
const { core } = useServices();
+ const notifications = useNotifications();
+ const newVideos = React.useMemo(() => {
+ const count = notifications.items?.[_id]?.length ?? 0;
+ return Math.min(Math.max(count, 0), 99);
+ }, [_id, notifications.items]);
const options = React.useMemo(() => {
return OPTIONS
.filter(({ value }) => {
@@ -68,6 +74,13 @@ const LibItem = ({ _id, removable, ...props }) => {
args: _id
}
});
+ core.transport.dispatch({
+ action: 'Ctx',
+ args: {
+ action: 'DismissNotificationItem',
+ args: _id
+ }
+ });
}
break;
@@ -91,6 +104,7 @@ const LibItem = ({ _id, removable, ...props }) => {
return (