mirror of
https://github.com/coracle-social/coracle.git
synced 2024-09-29 08:21:20 +00:00
Improve group invite deliverability
This commit is contained in:
parent
06df31a885
commit
8bbe09b4b1
@ -6,6 +6,7 @@
|
|||||||
- [x] Add group notes to group notifications
|
- [x] Add group notes to group notifications
|
||||||
- [x] Add badges to all notification page tabs
|
- [x] Add badges to all notification page tabs
|
||||||
- [x] Use better search algorithm and show loaded profiles in global search
|
- [x] Use better search algorithm and show loaded profiles in global search
|
||||||
|
- [x] Improve group invite deliverability
|
||||||
|
|
||||||
# 0.4.1
|
# 0.4.1
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
import GroupCircle from "src/app/shared/GroupCircle.svelte"
|
import GroupCircle from "src/app/shared/GroupCircle.svelte"
|
||||||
import GroupName from "src/app/shared/GroupName.svelte"
|
import GroupName from "src/app/shared/GroupName.svelte"
|
||||||
import PersonBadgeSmall from "src/app/shared/PersonBadgeSmall.svelte"
|
import PersonBadgeSmall from "src/app/shared/PersonBadgeSmall.svelte"
|
||||||
import {groupRequests} from "src/engine"
|
import {groupRequests, loadPubkeys} from "src/engine"
|
||||||
import {router} from "src/app/router"
|
import {router} from "src/app/router"
|
||||||
|
|
||||||
export let address
|
export let address
|
||||||
@ -36,6 +36,8 @@
|
|||||||
.open()
|
.open()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
loadPubkeys([request.pubkey])
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Card interactive>
|
<Card interactive>
|
||||||
|
@ -3,22 +3,24 @@
|
|||||||
import Anchor from "src/partials/Anchor.svelte"
|
import Anchor from "src/partials/Anchor.svelte"
|
||||||
import PersonCircle from "src/app/shared/PersonCircle.svelte"
|
import PersonCircle from "src/app/shared/PersonCircle.svelte"
|
||||||
import {router} from "src/app/router"
|
import {router} from "src/app/router"
|
||||||
import {displayPubkey} from "src/engine"
|
import {derivePerson, displayPerson} from "src/engine"
|
||||||
|
|
||||||
export let pubkey
|
export let pubkey
|
||||||
export let inert = false
|
export let inert = false
|
||||||
|
|
||||||
|
const person = derivePerson(pubkey)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if inert}
|
{#if inert}
|
||||||
<span class={cx($$props.class, "relative z-feature flex items-center gap-2")}>
|
<span class={cx($$props.class, "relative z-feature flex items-center gap-2")}>
|
||||||
<PersonCircle {pubkey} />
|
<PersonCircle {pubkey} />
|
||||||
<span>{displayPubkey(pubkey)}</span>
|
<span>{displayPerson($person)}</span>
|
||||||
</span>
|
</span>
|
||||||
{:else}
|
{:else}
|
||||||
<Anchor
|
<Anchor
|
||||||
href={router.at("people").of(pubkey).toString()}
|
href={router.at("people").of(pubkey).toString()}
|
||||||
class={cx($$props.class, "relative z-feature flex items-center gap-2")}>
|
class={cx($$props.class, "relative z-feature flex items-center gap-2")}>
|
||||||
<PersonCircle {pubkey} />
|
<PersonCircle {pubkey} />
|
||||||
<span>{displayPubkey(pubkey)}</span>
|
<span>{displayPerson($person)}</span>
|
||||||
</Anchor>
|
</Anchor>
|
||||||
{/if}
|
{/if}
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
const scroller = createScroller(loadMore, {element: getModal()})
|
const scroller = createScroller(loadMore, {element: getModal()})
|
||||||
|
|
||||||
const groupList = derived([groups, session], ([$groups, $session]) => {
|
const groupList = derived([groups, session], ([$groups, $session]) => {
|
||||||
const [joined, other] = partition(g => deriveIsGroupMember(g.address).get(), $groups)
|
const [joined, other] = partition(g => deriveIsGroupMember(g.address, true).get(), $groups)
|
||||||
|
|
||||||
return {joined, other}
|
return {joined, other}
|
||||||
})
|
})
|
||||||
|
@ -94,7 +94,7 @@ export const getGroupStatus = (session, address) =>
|
|||||||
export const deriveGroupStatus = address =>
|
export const deriveGroupStatus = address =>
|
||||||
session.derived($session => getGroupStatus($session, address))
|
session.derived($session => getGroupStatus($session, address))
|
||||||
|
|
||||||
export const getIsGroupMember = (session, address) => {
|
export const getIsGroupMember = (session, address, includeRequests = false) => {
|
||||||
const status = getGroupStatus(session, address)
|
const status = getGroupStatus(session, address)
|
||||||
|
|
||||||
if (address.startsWith("34550:")) {
|
if (address.startsWith("34550:")) {
|
||||||
@ -102,14 +102,18 @@ export const getIsGroupMember = (session, address) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (address.startsWith("35834:")) {
|
if (address.startsWith("35834:")) {
|
||||||
|
if (includeRequests && status.access === GroupAccess.Requested) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
return status.access === GroupAccess.Granted
|
return status.access === GroupAccess.Granted
|
||||||
}
|
}
|
||||||
|
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
export const deriveIsGroupMember = address =>
|
export const deriveIsGroupMember = (address, includeRequests = false) =>
|
||||||
session.derived($session => getIsGroupMember($session, address))
|
session.derived($session => getIsGroupMember($session, address, includeRequests))
|
||||||
|
|
||||||
export const deriveGroupOptions = (defaultGroups = []) =>
|
export const deriveGroupOptions = (defaultGroups = []) =>
|
||||||
session.derived($session => {
|
session.derived($session => {
|
||||||
|
Loading…
Reference in New Issue
Block a user