Skip to content

Commit

Permalink
feat: remove auto play music when enter first page
Browse files Browse the repository at this point in the history
  • Loading branch information
LiuXianJing committed Apr 12, 2024
1 parent 0f91222 commit 98c4fb0
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
5 changes: 0 additions & 5 deletions frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 <>
<BrowserRouter future={{ v7_startTransition: true }}>
<ConfigProvider locale={enUS}>
Expand Down
3 changes: 1 addition & 2 deletions frontend/src/views/ChatChat/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 = () => {
Expand All @@ -11,7 +11,6 @@ const ChatChat = () => {

useEffect(() => {
getChatData()
playMusic()
/* let timer = setInterval(() => {
getChatData()
}, 2 * 1000)
Expand Down

0 comments on commit 98c4fb0

Please sign in to comment.