File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ import {
2525 Trophy ,
2626} from " lucide-vue-next" ;
2727import { useAuthStore } from " ~/stores/AuthStore" ;
28+ import { e_player_roles_enum } from " ~/generated/zeus" ;
2829import CreateClipDialog from " ~/components/clips/CreateClipDialog.vue" ;
2930import { Button } from " ~/components/ui/button" ;
3031import { Kbd } from " ~/components/ui/kbd" ;
@@ -50,9 +51,12 @@ import RoundSelector from "~/components/match/RoundSelector.vue";
5051import SpectatorSlots from " ~/components/stream-deck/SpectatorSlots.vue" ;
5152import { resolveKeyToRealSlot } from " ~/utilities/streamerSpecSlots" ;
5253
53- // API gates clip creation at verified_user; we only check "logged in"
54- // on the client so any logged-in viewer sees the button.
55- const canCreateClip = computed (() => !! useAuthStore ().me ?.steam_id );
54+ // API gates clip creation at streamer; mirror that on the client so a
55+ // non-streamer viewer (e.g. a plain-user organizer watching their own demo)
56+ // doesn't see a button the action would reject.
57+ const canCreateClip = computed (() =>
58+ useAuthStore ().isRoleAbove (e_player_roles_enum .streamer ),
59+ );
5660const showCreateClipDialog = ref (false );
5761const dialogInitialMode = ref <" manual" | " auto" >(" auto" );
5862const editor = useClipEditor ();
Original file line number Diff line number Diff line change @@ -175,7 +175,7 @@ import {
175175 {{ $t("match.actions.stop_live") }}
176176 </template >
177177 </DropdownMenuItem >
178- <Tooltip v-if =" hasMatchDemos && ! hasRegisteredGpu " >
178+ <Tooltip v-if =" canCreateClips && ! hasRegisteredGpu " >
179179 <TooltipTrigger as-child>
180180 <DropdownMenuItem disabled>
181181 {{ $t("match.actions.create_clips") }}
@@ -186,7 +186,7 @@ import {
186186 </TooltipContent >
187187 </Tooltip >
188188 <DropdownMenuItem
189- v-else-if =" hasMatchDemos "
189+ v-else-if =" canCreateClips "
190190 @click =" createClipsForMatch "
191191 >
192192 {{ $t("match.actions.create_clips") }}
@@ -887,6 +887,12 @@ export default {
887887 useAuthStore ().isRoleAbove (e_player_roles_enum .administrator )
888888 );
889889 },
890+ canCreateClips() {
891+ return (
892+ this .hasMatchDemos &&
893+ useAuthStore ().isRoleAbove (e_player_roles_enum .administrator )
894+ );
895+ },
890896 hasMinimumLineupPlayers() {
891897 return (
892898 this .match .lineup_1 ?.lineup_players .length >=
You can’t perform that action at this time.
0 commit comments