mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-12 19:30:52 +00:00
UBER-241 UBER-244 UBER-245 UBER-246 Inbox fixes (#3256)
Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
parent
5c4c96d3f2
commit
7233d15ba0
@ -115,9 +115,8 @@
|
||||
const client = getClient()
|
||||
|
||||
async function openDM () {
|
||||
const current = (await client.findAll(chunter.class.DirectMessage, { members: accountId })).find(
|
||||
(p) => p.members.length === 2
|
||||
)
|
||||
const res = await client.findAll(chunter.class.DirectMessage, { members: accountId })
|
||||
const current = res.find((p) => p.members.includes(me) && p.members.length === 2)
|
||||
if (current !== undefined) {
|
||||
dispatch('dm', current._id)
|
||||
} else {
|
||||
|
@ -24,7 +24,7 @@
|
||||
const store = notificationClient.docUpdatesStore
|
||||
$: docUpdate = $store.get(value._id)
|
||||
|
||||
$: hasNotification = (docUpdate?.txes?.length ?? 0) > 0 && docUpdate?.hidden !== true
|
||||
$: hasNotification = docUpdate?.txes?.some((p) => p.isNew) && docUpdate?.hidden !== true
|
||||
</script>
|
||||
|
||||
{#if hasNotification}
|
||||
|
@ -34,8 +34,10 @@
|
||||
const client = getClient()
|
||||
const hierarchy = client.getHierarchy()
|
||||
|
||||
$: value.txes[0] &&
|
||||
client.findOne(core.class.TxCUD, { _id: value.txes[0]._id }).then((res) => {
|
||||
$: txRef = value.txes[value.txes.length - 1]._id
|
||||
|
||||
$: txRef &&
|
||||
client.findOne(core.class.TxCUD, { _id: txRef }).then((res) => {
|
||||
if (res !== undefined) {
|
||||
tx = TxProcessor.extractTx(res) as TxCUD<Doc>
|
||||
} else {
|
||||
@ -64,9 +66,9 @@
|
||||
</script>
|
||||
|
||||
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
||||
<div class="container cursor-pointer" class:selected>
|
||||
<div class="notify" class:hidden={newTxes === 0} />
|
||||
{#if doc}
|
||||
{#if doc}
|
||||
<div class="container cursor-pointer" class:selected>
|
||||
<div class="notify" class:hidden={newTxes === 0} />
|
||||
<div
|
||||
class="clear-mins content bottom-divider"
|
||||
class:read={newTxes === 0}
|
||||
@ -94,8 +96,8 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<style lang="scss">
|
||||
.time {
|
||||
|
@ -45,8 +45,10 @@
|
||||
const client = getClient()
|
||||
const hierarchy = client.getHierarchy()
|
||||
|
||||
$: firstItem?.txes[0] &&
|
||||
client.findOne(core.class.TxCUD, { _id: firstItem.txes[0]._id }).then((res) => {
|
||||
$: txRef = firstItem ? firstItem.txes[firstItem.txes.length - 1]._id : undefined
|
||||
|
||||
$: txRef &&
|
||||
client.findOne(core.class.TxCUD, { _id: txRef }).then((res) => {
|
||||
if (res !== undefined) {
|
||||
tx = TxProcessor.extractTx(res) as TxCUD<Doc>
|
||||
} else {
|
||||
@ -72,16 +74,16 @@
|
||||
$: if (selected && div !== undefined) div.focus()
|
||||
</script>
|
||||
|
||||
<div
|
||||
class="container cursor-pointer"
|
||||
on:keydown
|
||||
class:selected
|
||||
tabindex="-1"
|
||||
bind:this={div}
|
||||
on:click={() => dispatch('open', value._id)}
|
||||
>
|
||||
<div class="notify" class:hidden={newTxes === 0} />
|
||||
{#if doc}
|
||||
{#if doc}
|
||||
<div
|
||||
class="container cursor-pointer"
|
||||
on:keydown
|
||||
class:selected
|
||||
tabindex="-1"
|
||||
bind:this={div}
|
||||
on:click={() => dispatch('open', value._id)}
|
||||
>
|
||||
<div class="notify" class:hidden={newTxes === 0} />
|
||||
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
||||
<div class="clear-mins content bottom-divider" class:read={newTxes === 0}>
|
||||
<div class="w-full">
|
||||
@ -124,8 +126,8 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<style lang="scss">
|
||||
.time {
|
||||
|
Loading…
Reference in New Issue
Block a user