mirror of
https://github.com/ericasch6/scrum-poker-internal.git
synced 2026-10-15 07:26:09 +00:00
removed throttle for mod
This commit is contained in:
@@ -17,6 +17,7 @@ const THROW_BUTTON_COOLDOWN = 550;
|
||||
export function usePaperBallToss({
|
||||
roomId,
|
||||
currentPlayerId,
|
||||
currentPlayerIsModerator,
|
||||
board,
|
||||
}: PaperBallTossOptions) {
|
||||
const activePaperBalls = ref<PaperBallFlight[]>([]);
|
||||
@@ -35,9 +36,11 @@ export function usePaperBallToss({
|
||||
}
|
||||
|
||||
async function throwPaperBall(targetPlayerId: number): Promise<void> {
|
||||
const shouldApplyCooldown = !currentPlayerIsModerator();
|
||||
|
||||
if (
|
||||
targetPlayerId === currentPlayerId() ||
|
||||
throwingAtPlayerId.value !== null
|
||||
(shouldApplyCooldown && throwingAtPlayerId.value !== null)
|
||||
) {
|
||||
return;
|
||||
}
|
||||
@@ -52,7 +55,9 @@ export function usePaperBallToss({
|
||||
return;
|
||||
}
|
||||
|
||||
throwingAtPlayerId.value = targetPlayerId;
|
||||
if (shouldApplyCooldown) {
|
||||
throwingAtPlayerId.value = targetPlayerId;
|
||||
}
|
||||
|
||||
try {
|
||||
const response = await fetch(throwPaperBallRoute(roomId()).url, {
|
||||
@@ -91,11 +96,13 @@ export function usePaperBallToss({
|
||||
} catch {
|
||||
toast.error('Der Papierknäuel konnte nicht geworfen werden.');
|
||||
} finally {
|
||||
schedule(() => {
|
||||
if (throwingAtPlayerId.value === targetPlayerId) {
|
||||
throwingAtPlayerId.value = null;
|
||||
}
|
||||
}, THROW_BUTTON_COOLDOWN);
|
||||
if (shouldApplyCooldown) {
|
||||
schedule(() => {
|
||||
if (throwingAtPlayerId.value === targetPlayerId) {
|
||||
throwingAtPlayerId.value = null;
|
||||
}
|
||||
}, THROW_BUTTON_COOLDOWN);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user