Skip to content

Commit 37394d0

Browse files
committed
Fix: canManageChannelEventsの定義を忘れてた...
1 parent 53fb168 commit 37394d0

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

packages/frontend/src/pages/channel.vue

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ type ChannelManageStatus = GetMkSelectValueTypesFromDef<typeof channelManageStat
208208
const tab = ref('overview');
209209
210210
const channel = ref<Misskey.entities.Channel | null>(null);
211+
const canManageChannelEvents = computed(() => hasChannelEventManagePermission(channel.value));
211212
const favorited = ref(false);
212213
const searchQuery = ref('');
213214
const searchPaginator = shallowRef();
@@ -365,6 +366,13 @@ async function search() {
365366
searchKey.value = query;
366367
}
367368
369+
function hasChannelEventManagePermission(targetChannel: Misskey.entities.Channel | null): boolean {
370+
if (!$i || targetChannel == null) return false;
371+
if (iAmModerator) return true;
372+
373+
return $i.id === targetChannel.userId || targetChannel.collaboratorIds?.includes($i.id) === true;
374+
}
375+
368376
// Channel events
369377
const selectedEventDate = ref<string | null>(null);
370378
const channelEvents = ref<Misskey.entities.Event[]>([]);

0 commit comments

Comments
 (0)