TSK-1341 Remove last view (#3115)

Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
Denis Bykhov
2023-04-29 22:46:13 +07:00
committed by GitHub
parent 9b04d366e3
commit ae8fcf8d62
41 changed files with 204 additions and 645 deletions
@@ -13,8 +13,8 @@
// limitations under the License.
-->
<script lang="ts">
import contact, { EmployeeAccount } from '@hcengineering/contact'
import { Doc, getCurrentAccount, Ref } from '@hcengineering/core'
import { EmployeeAccount } from '@hcengineering/contact'
import { getCurrentAccount, Ref } from '@hcengineering/core'
import {
NotificationProvider,
NotificationSetting,
@@ -26,14 +26,10 @@
import { getCurrentLocation, showPanel } from '@hcengineering/ui'
import view from '@hcengineering/view'
import notification from '../plugin'
import { NotificationClientImpl } from '../utils'
const query = createQuery()
const settingQuery = createQuery()
const providersQuery = createQuery()
const notificationClient = NotificationClientImpl.getClient()
const lastViews = notificationClient.getLastViews()
const lastViewId: Ref<Doc> = ((getCurrentAccount() as EmployeeAccount).employee + 'notification') as Ref<Doc>
let settingsReceived = false
let settings: Map<Ref<NotificationType>, NotificationSetting> = new Map<Ref<NotificationType>, NotificationSetting>()
@@ -129,16 +125,6 @@
alreadyShown.clear()
}, 5000)
const lastView = ($lastViews as any)[lastViewId]
if ((lastView ?? notifyInstance.modifiedOn) > 0) {
await notificationClient.updateLastView(
lastViewId,
contact.class.Employee,
notifyInstance.modifiedOn,
lastView === undefined
)
}
// eslint-disable-next-line
const notification = new Notification(getCurrentLocation().path[1], {
tag: notifyInstance._id,
@@ -24,7 +24,7 @@
const store = notificationClient.docUpdatesStore
$: docUpdate = $store.get(value._id)
$: hasNotification = (docUpdate?.txes?.length ?? 0) > 0
$: hasNotification = (docUpdate?.txes?.length ?? 0) > 0 && docUpdate?.hidden !== true
</script>
{#if hasNotification}