Skip to content

Commit

Permalink
Merge pull request #2485 from Thorium-Sim/develop
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
alexanderson1993 authored Aug 3, 2019
2 parents a275573 + 860616c commit fc051ea
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 11 deletions.
1 change: 1 addition & 0 deletions client/src/components/generic/SoundPlayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ function downMixBuffer(buffer, channel) {
}

export function playSound(opts) {
if (!opts.asset) return;
removeSound(opts.id, true);
opts.id = opts.id || uuid.v4();
const volume = opts.muted ? 0 : opts.volume || 1;
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/views/DamageControl/damageControl.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ class DamageControl extends Component {
return {
...t,
className: systemClasses(t),
actve: selectedSystem === t.id,
active: selectedSystem === t.id,
type: "task",
onClick: () => this.selectSystem(t.id),
children: (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import gql from "graphql-tag.macro";
import { Button } from "helpers/reactstrap";

const ReportViewTask = ({ system, stepDamage }) => {
const task = system.tasks.find(t => !t.verified);
const task = system.tasks.find(t => !t.verified) || {};
if (stepDamage) {
// Get the first task that isn't verified;
const stepCount = system.tasks.findIndex(t => t.id === task.id) + 1;
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/views/JumpDrive/powerLine.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const PowerLine = ({
const [measureRef, { left, width }] = useMeasure();
const playEffect = useSoundEffect();
React.useEffect(() => {
if (power) {
if (power || power === 0) {
setStoredPower(power);
}
}, [power]);
Expand Down
4 changes: 3 additions & 1 deletion client/src/components/views/Tasks/tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,9 @@ class Tasks extends Component {
/>
</h3>
<Card>
<CardBlock>{task && task.instructions}</CardBlock>
<CardBlock style={{ whiteSpace: "pre-line" }}>
{task && task.instructions}
</CardBlock>
</Card>
<div style={{ display: "flex", justifyContent: "space-between" }}>
<Mutation
Expand Down
6 changes: 3 additions & 3 deletions client/src/helpers/graphqlClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { FLIGHTS_QUERY } from "../containers/FlightDirector/Welcome/Welcome";
import { getClientId } from "helpers/getClientId";
import { setContext } from "apollo-link-context";

import * as Sentry from "@sentry/browser";
// import * as Sentry from "@sentry/browser";

const hostname = window.location.hostname;

Expand All @@ -23,12 +23,12 @@ const wsLink = ApolloLink.from([
console.log(
`[Subscription Error]: Message: ${message}, Location: ${locations}, Path: ${path}`
);
Sentry.captureException(error);
// Sentry.captureException(error);
});

if (networkError) {
console.log(`[Network error]: ${networkError}`);
Sentry.captureException(networkError);
// Sentry.captureException(networkError);
}
if (response) response.errors = null;
}),
Expand Down
3 changes: 2 additions & 1 deletion server/src/events/flight.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ export const aspectList = [
"commandLine",
"triggerGroups",
"interfaces",
"tasks"
"tasks",
"taskReports"
];

export function addAspects(template, sim, data = App) {
Expand Down
4 changes: 3 additions & 1 deletion server/src/events/macro.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ App.on("updateMacroActions", ({ id, actions }) => {
});
App.on("triggerMacroAction", ({ macroId, simulatorId }) => {
const macro = App.macros.find(s => s.id === macroId);

if (!macro) {
return;
}
// Don't allow a macro to trigger itself
const macros = macro.actions.filter(a => {
const args = typeof a.args === "string" ? JSON.parse(a.args) : a.args;
Expand Down
3 changes: 2 additions & 1 deletion server/src/events/tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ App.on("addTask", ({ taskInput, simulatorId }) => {
const task = new Classes.Task(input);
App.tasks.push(task);
// Execute the pre-macros
taskInput.preMacros.length > 0 &&
taskInput.preMacros &&
taskInput.preMacros.length > 0 &&
App.handleEvent(
{ simulatorId: task.simulatorId, macros: taskInput.preMacros },
"triggerMacros"
Expand Down
6 changes: 5 additions & 1 deletion server/src/tasks/internalComm.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,16 @@ export default [
const station = simulator.stations.find(s =>
s.cards.find(c => c.component === "CommInternal")
);
const idRegex = /.{8}-.{4}-.{4}-.{4}-.{12}/gi;

const room = App.rooms.find(r => r.id === roomId);
const deck = App.decks.find(d => d.id === (room ? room.deckId : roomId));
const decks = App.decks.find(d => d.simulatorId === simulator.id);
const randomDeck = randomFromList(decks);
const location =
!room && !deck
roomId && !roomId.match(idRegex)
? roomId
: !room && !deck
? `Deck ${randomDeck ? randomDeck.number : 1}`
: room
? `${room.name}, Deck ${deck.number}`
Expand Down

0 comments on commit fc051ea

Please sign in to comment.