Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(electron): correct assets root #1493

Merged
merged 1 commit into from
Apr 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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