Skip to content

Commit

Permalink
fix(electron): correct assets root (#1493)
Browse files Browse the repository at this point in the history
  • Loading branch information
crimx authored Apr 21, 2022
1 parent 97859ba commit 290728e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
2 changes: 1 addition & 1 deletion desktop/main-app/src/utils/runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const isDebug = process.env.FLAT_DEBUG === "debug";

const assetsPath = isProduction
? path.resolve(__dirname, "..", "static")
: path.resolve(__dirname, "..", "..", "..", "renderer-app", "src", "assets");
: path.resolve(__dirname, "..", "..", "..", "renderer-app");

const startURL = isProduction
? `file://${path.resolve(__dirname, "..", "static", "index.html")}`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ import "./index.less";
import React, { useCallback, useContext, useEffect, useState } from "react";
import { Slider, Button } from "antd";
import { useHistory, useLocation } from "react-router-dom";
// let webpack recognize
import "../../../assets/media/Goldberg Variations, BWV 988 - 05 - Variatio 4 a 1 Clav.mp3";
import audioTestMP3 from "../../../assets/media/Goldberg Variations, BWV 988 - 05 - Variatio 4 a 1 Clav.mp3";
import { DeviceSelect } from "../../../components/DeviceSelect";
import { Device } from "../../../types/device";
import { DeviceCheckLayoutContainer } from "../DeviceCheckLayoutContainer";
Expand Down Expand Up @@ -51,13 +50,7 @@ export const SpeakerCheckPage = (): React.ReactElement => {

useEffect(() => {
if (currentDeviceID && isPlaying) {
rtc.startSpeakerTest(
path.join(
runtime.assetsPath,
"media",
"Goldberg Variations, BWV 988 - 05 - Variatio 4 a 1 Clav.mp3",
),
);
rtc.startSpeakerTest(path.join(runtime.assetsPath, audioTestMP3));
return () => {
rtc.stopSpeakerTest();
};
Expand Down

0 comments on commit 290728e

Please sign in to comment.