Skip to content

Commit

Permalink
🐞 fix: 修复当电台模式时播放列表出现错误
Browse files Browse the repository at this point in the history
  • Loading branch information
imsyy committed Dec 27, 2023
1 parent 99ab194 commit 8f416ff
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
6 changes: 3 additions & 3 deletions electron.vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@ export default defineConfig(({ mode }) => {
],
},
manifest: {
name: loadEnv(mode, process.cwd()).RENDERER_VITE_SITE_TITLE,
short_name: loadEnv(mode, process.cwd()).RENDERER_VITE_SITE_TITLE,
description: loadEnv(mode, process.cwd()).RENDERER_VITE_SITE_DES,
name: getEnv("RENDERER_VITE_SITE_TITLE"),
short_name: getEnv("RENDERER_VITE_SITE_TITLE"),
description: getEnv("RENDERER_VITE_SITE_DES"),
display: "standalone",
start_url: "/",
theme_color: "#fff",
Expand Down
3 changes: 1 addition & 2 deletions electron/main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,11 @@ class MainProcess {
icon: nativeImage.createFromPath(join(__dirname, "../../public/images/icons/favicon.png")),
// 预加载
webPreferences: {
// devTools: is.dev, //是否开启 DevTools
devTools: is.dev,
preload: join(__dirname, "../preload/index.js"),
sandbox: false,
webSecurity: false,
hardwareAcceleration: true,
nodeIntegration: true,
},
});

Expand Down
2 changes: 1 addition & 1 deletion src/components/Global/Playlist.vue
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ const playlistOpen = () => {
// 播放歌曲
const playSong = debounce(async (song, index) => {
// 更改模式
playMode.value = "normal";
if (playMode.value !== "dj") playMode.value = "normal";
// 更改播放索引
playIndex.value = index;
// 是否为当前播放歌曲
Expand Down
4 changes: 3 additions & 1 deletion src/utils/globalEvents.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { checkPlatform } from "@/utils/helper";
import { playOrPause, changePlayIndex } from "@/utils/Player";
import { siteStatus } from "@/stores";
import { siteStatus, musicData } from "@/stores";

/**
* 全局事件
Expand All @@ -11,6 +11,8 @@ const globalEvents = (router) => {
// 显示播放器
electron.ipcRenderer.on("showPlayer", () => {
const status = siteStatus();
const music = musicData();
if (music.playMode === "dj") return false;
status.showFullPlayer = true;
});
// 播放或暂停
Expand Down

0 comments on commit 8f416ff

Please sign in to comment.