Skip to content

Commit

Permalink
feat: remove the game pause function for visitors
Browse files Browse the repository at this point in the history
  • Loading branch information
cuixiaorui committed Aug 7, 2024
1 parent ce4153d commit 197be04
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions apps/client/components/main/Tool.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
<!-- 右侧 -->
<div class="flex items-center gap-4">
<div
v-if="isAuthenticated()"
:data-tippy-content="`暂停游戏 (${shortcutKeys.pause})`"
@click="pauseGame"
@mouseenter="$lazyTippy"
Expand Down Expand Up @@ -86,6 +87,7 @@ import { clearQuestionInput } from "~/composables/main/question";
import { useGamePause } from "~/composables/main/useGamePause";
import { useRanking } from "~/composables/rank/rankingList";
import { useShortcutKeyMode } from "~/composables/user/shortcutKey";
import { isAuthenticated } from "~/services/auth";
import { useCourseStore } from "~/store/course";
import { useGameStore } from "~/store/game";
import { cancelShortcut, registerShortcut } from "~/utils/keyboardShortcuts";
Expand Down Expand Up @@ -118,6 +120,9 @@ const currentPercentage = computed(() => {
});
function useGamePauseWrapper() {
// 游客不会显示倒计时 所以暂停功能是不需要的
if (!isAuthenticated()) return;
const gameStore = useGameStore();
function handleGamePause() {
Expand Down

0 comments on commit 197be04

Please sign in to comment.