diff --git a/core/src/components/login-view/login-view.js b/core/src/components/login-view/login-view.js index c29be5ab..24bef336 100644 --- a/core/src/components/login-view/login-view.js +++ b/core/src/components/login-view/login-view.js @@ -15,7 +15,7 @@ import './login-section.js' import '../qort-theme-toggle.js' import settings from '../../functional-components/settings-page.js' -import { addAutoLoadImageChat, removeAutoLoadImageChat, addChatLastSeen, allowQAPPAutoAuth, removeQAPPAutoAuth, removeQAPPAutoLists, allowQAPPAutoLists } from '../../redux/app/app-actions.js' +import { addAutoLoadImageChat, removeAutoLoadImageChat, addChatLastSeen, allowQAPPAutoAuth, removeQAPPAutoAuth, removeQAPPAutoLists, allowQAPPAutoLists, addTabInfo, setTabNotifications, setNewTab } from '../../redux/app/app-actions.js' window.reduxStore = store window.reduxAction = { @@ -25,7 +25,10 @@ window.reduxAction = { allowQAPPAutoAuth: allowQAPPAutoAuth, removeQAPPAutoAuth: removeQAPPAutoAuth, allowQAPPAutoLists: allowQAPPAutoLists, - removeQAPPAutoLists: removeQAPPAutoLists + removeQAPPAutoLists: removeQAPPAutoLists, + addTabInfo: addTabInfo, + setTabNotifications: setTabNotifications, + setNewTab: setNewTab } const animationDuration = 0.7 // Seconds diff --git a/core/src/components/show-plugin.js b/core/src/components/show-plugin.js index 4cf8d729..4f68ffee 100644 --- a/core/src/components/show-plugin.js +++ b/core/src/components/show-plugin.js @@ -6,9 +6,13 @@ import { addPluginRoutes } from '../plugins/addPluginRoutes.js' import { repeat } from 'lit/directives/repeat.js'; import ShortUniqueId from 'short-unique-id'; import { setNewTab } from '../redux/app/app-actions.js' +import localForage from "localforage"; import '@material/mwc-icon' +const chatLastSeen = localForage.createInstance({ + name: "chat-last-seen", +}); class ShowPlugin extends connect(store)(LitElement) { static get properties() { return { @@ -19,7 +23,10 @@ class ShowPlugin extends connect(store)(LitElement) { registeredUrls: { type: Array }, currentTab: { type: Number }, tabs: { type: Array }, - theme: { type: String, reflect: true } + theme: { type: String, reflect: true }, + tabInfo: { type: Object }, + chatLastSeen: { type: Array }, + chatHeads: { type: Array } } } @@ -155,6 +162,20 @@ class ShowPlugin extends connect(store)(LitElement) { color: #999; --mdc-icon-size: 20px; } + + .count { + position: absolute; + background: red; + color: white; + padding: 5px; + font-size: 12px; + border-radius: 50%; + height: 10px; + width: 10px; + display: flex; + justify-content: center; + align-items: center; + } ` } @@ -165,6 +186,9 @@ class ShowPlugin extends connect(store)(LitElement) { this.tabs = [] this.uid = new ShortUniqueId() this.theme = localStorage.getItem('qortalTheme') ? localStorage.getItem('qortalTheme') : 'light' + this.tabInfo = {} + this.chatLastSeen = [] + this.chatHeads = [] } async getUpdateComplete() { @@ -189,9 +213,44 @@ class ShowPlugin extends connect(store)(LitElement) { return myPlug === undefined ? 'about:blank' : `${window.location.origin}/plugin/${myPlug.domain}/${myPlug.page}${this.linkParam}` } + return html`