mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-08 18:57:42 +02:00
TSK-1341 Remove last view (#3115)
Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
@@ -47,7 +47,6 @@
|
||||
export let embedded = false
|
||||
|
||||
let lastId: Ref<Doc> = _id
|
||||
let lastClass: Ref<Class<Doc>> = _class
|
||||
const queryClient = createQuery()
|
||||
const dispatch = createEventDispatcher()
|
||||
const client = getClient()
|
||||
@@ -66,15 +65,13 @@
|
||||
function read (_id: Ref<Doc>) {
|
||||
if (lastId !== _id) {
|
||||
const prev = lastId
|
||||
const prevClass = lastClass
|
||||
lastId = _id
|
||||
lastClass = _class
|
||||
notificationClient.then((client) => client.updateLastView(prev, prevClass))
|
||||
notificationClient.then((client) => client.read(prev))
|
||||
}
|
||||
}
|
||||
|
||||
onDestroy(async () => {
|
||||
notificationClient.then((client) => client.updateLastView(_id, _class))
|
||||
notificationClient.then((client) => client.read(_id))
|
||||
})
|
||||
|
||||
$: _id &&
|
||||
|
||||
@@ -46,7 +46,6 @@
|
||||
export let _class: Ref<Class<IssueTemplate>>
|
||||
|
||||
let lastId: Ref<Doc> = _id
|
||||
let lastClass: Ref<Class<Doc>> = _class
|
||||
const query = createQuery()
|
||||
const dispatch = createEventDispatcher()
|
||||
const client = getClient()
|
||||
@@ -65,15 +64,13 @@
|
||||
function read (_id: Ref<Doc>) {
|
||||
if (lastId !== _id) {
|
||||
const prev = lastId
|
||||
const prevClass = lastClass
|
||||
lastId = _id
|
||||
lastClass = _class
|
||||
notificationClient.then((client) => client.updateLastView(prev, prevClass))
|
||||
notificationClient.then((client) => client.read(prev))
|
||||
}
|
||||
}
|
||||
|
||||
onDestroy(async () => {
|
||||
notificationClient.then((client) => client.updateLastView(_id, _class))
|
||||
notificationClient.then((client) => client.read(_id))
|
||||
})
|
||||
|
||||
$: _id &&
|
||||
|
||||
Reference in New Issue
Block a user