mirror of
https://iceshrimp.dev/crimekillz/iceshrimp-161sh.git
synced 2024-11-22 20:23:49 +01:00
Merge pull request 'Don't show channel edit button unless owner' (#9722) from supakaity/hajkey:hk-channel-owner-edit into develop
Reviewed-on: https://codeberg.org/calckey/calckey/pulls/9722
This commit is contained in:
commit
451b61e38f
@ -51,13 +51,6 @@ const props = defineProps<{
|
||||
|
||||
let channel = $ref(null);
|
||||
let showBanner = $ref(true);
|
||||
const pagination = {
|
||||
endpoint: 'channels/timeline' as const,
|
||||
limit: 10,
|
||||
params: computed(() => ({
|
||||
channelId: props.channelId,
|
||||
})),
|
||||
};
|
||||
|
||||
watch(() => props.channelId, async () => {
|
||||
channel = await os.api('channels/show', {
|
||||
@ -66,14 +59,23 @@ watch(() => props.channelId, async () => {
|
||||
}, { immediate: true });
|
||||
|
||||
function edit() {
|
||||
router.push(`/channels/${channel.id}/edit`);
|
||||
router.push(`/channels/${channel?.id}/edit`);
|
||||
}
|
||||
|
||||
const headerActions = $computed(() => channel && channel.userId ? [{
|
||||
icon: 'ph-gear-six ph-bold ph-lg',
|
||||
text: i18n.ts.edit,
|
||||
handler: edit,
|
||||
}] : null);
|
||||
const headerActions = $computed(() => [
|
||||
...(
|
||||
channel
|
||||
&& channel?.userId === $i?.id
|
||||
? [
|
||||
{
|
||||
icon: 'ph-gear-six ph-bold ph-lg',
|
||||
text: i18n.ts.edit,
|
||||
handler: edit,
|
||||
}
|
||||
]
|
||||
: []
|
||||
),
|
||||
]);
|
||||
|
||||
const headerTabs = $computed(() => []);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user