From 98c4fb05854c28a6ab81faf56b84512adc57a5bc Mon Sep 17 00:00:00 2001 From: XJ <2311486045@qq.com> Date: Fri, 12 Apr 2024 20:14:21 +0800 Subject: [PATCH] feat: remove auto play music when enter first page --- frontend/src/App.tsx | 5 ----- frontend/src/views/ChatChat/index.tsx | 3 +-- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 80f7734..2b35bae 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -22,15 +22,10 @@ import VisualLargeScreen from "./views/VisualLargeScreen"; import Other from "./views/Other"; import ChatChat from "./views/ChatChat"; import majesticMusic from './assets/audio/majestic_music.mp3' -import { playMusic } from "./utils"; import './App.less' function App() { - useEffect(() => { - playMusic() - }, []) - return <> diff --git a/frontend/src/views/ChatChat/index.tsx b/frontend/src/views/ChatChat/index.tsx index b985084..b7848ea 100644 --- a/frontend/src/views/ChatChat/index.tsx +++ b/frontend/src/views/ChatChat/index.tsx @@ -2,7 +2,7 @@ import { useEffect, useState } from "react" import Chat from "../../components/Chat" import { ChatDataType } from "../../types" import { getChatMessagesAPI, sendChatMessageAPI, } from "../../api" -import { getUserAvatarUrl, playMusic } from "../../utils" +import { getUserAvatarUrl, } from "../../utils" import './index.less' const ChatChat = () => { @@ -11,7 +11,6 @@ const ChatChat = () => { useEffect(() => { getChatData() - playMusic() /* let timer = setInterval(() => { getChatData() }, 2 * 1000)