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