Don't show channel edit button unless owner
This commit is contained in:
parent
9e1fdeaf39
commit
53d482d209
|
@ -51,13 +51,6 @@ const props = defineProps<{
|
||||||
|
|
||||||
let channel = $ref(null);
|
let channel = $ref(null);
|
||||||
let showBanner = $ref(true);
|
let showBanner = $ref(true);
|
||||||
const pagination = {
|
|
||||||
endpoint: 'channels/timeline' as const,
|
|
||||||
limit: 10,
|
|
||||||
params: computed(() => ({
|
|
||||||
channelId: props.channelId,
|
|
||||||
})),
|
|
||||||
};
|
|
||||||
|
|
||||||
watch(() => props.channelId, async () => {
|
watch(() => props.channelId, async () => {
|
||||||
channel = await os.api('channels/show', {
|
channel = await os.api('channels/show', {
|
||||||
|
@ -66,14 +59,23 @@ watch(() => props.channelId, async () => {
|
||||||
}, { immediate: true });
|
}, { immediate: true });
|
||||||
|
|
||||||
function edit() {
|
function edit() {
|
||||||
router.push(`/channels/${channel.id}/edit`);
|
router.push(`/channels/${channel?.id}/edit`);
|
||||||
}
|
}
|
||||||
|
|
||||||
const headerActions = $computed(() => channel && channel.userId ? [{
|
const headerActions = $computed(() => [
|
||||||
icon: 'ph-gear-six ph-bold ph-lg',
|
...(
|
||||||
text: i18n.ts.edit,
|
channel
|
||||||
handler: edit,
|
&& channel?.userId === $i?.id
|
||||||
}] : null);
|
? [
|
||||||
|
{
|
||||||
|
icon: 'ph-gear-six ph-bold ph-lg',
|
||||||
|
text: i18n.ts.edit,
|
||||||
|
handler: edit,
|
||||||
|
}
|
||||||
|
]
|
||||||
|
: []
|
||||||
|
),
|
||||||
|
]);
|
||||||
|
|
||||||
const headerTabs = $computed(() => []);
|
const headerTabs = $computed(() => []);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue