mirror of
https://github.com/coracle-social/flotilla.git
synced 2025-12-10 10:57:04 +00:00
Fix image modal, only show + room if the user is allowed
This commit is contained in:
@@ -34,6 +34,7 @@
|
||||
target: element,
|
||||
props: {
|
||||
onClose: closeModals,
|
||||
fullscreen: options.fullscreen,
|
||||
children: createRawSnippet(() => ({
|
||||
render: () => "<div></div>",
|
||||
setup: (target: Element) => {
|
||||
|
||||
@@ -882,11 +882,19 @@ export const deriveUserRoomMembershipStatus = (url: string, h: string) =>
|
||||
|
||||
export const deriveUserCanCreateRoom = (url: string) =>
|
||||
derived(
|
||||
[pubkey, deriveEventsForUrl(url, [{kinds: [ROOM_CREATE_PERMISSION]}])],
|
||||
([$pubkey, $events]) => {
|
||||
const event = first($events)
|
||||
[
|
||||
pubkey,
|
||||
deriveEventsForUrl(url, [{kinds: [ROOM_CREATE_PERMISSION]}]),
|
||||
deriveUserIsSpaceAdmin(url),
|
||||
],
|
||||
([$pubkey, $events, $isAdmin]) => {
|
||||
for (const event of $events) {
|
||||
if (getPubkeyTagValues(event.tags).includes($pubkey!)) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return event ? getPubkeyTagValues(event.tags).includes($pubkey!) : true
|
||||
return $isAdmin
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
transition:fade={{duration: 300}}
|
||||
onclick={onClose}>
|
||||
</button>
|
||||
<div class="scroll-container {extraClass}" transition:fly={{duration: 300}}>
|
||||
<div class="scroll-container relative {extraClass}" transition:fly={{duration: 300}}>
|
||||
{@render children?.()}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user