Don't add *** to nonlooping marquee text

Fixes #726
This commit is contained in:
Jordan Eldredge 2019-02-17 14:58:54 -08:00
parent 2df185b1a3
commit 1fdbbb844a
3 changed files with 3 additions and 4 deletions

View file

@ -66,7 +66,7 @@ describe("loopText", () => {
const short = "This is a short string.";
it("loops long string", () => {
const actual = loopText(long);
const expected = long + long;
const expected = `${long} *** ${long}`;
expect(actual).toEqual(expected);
});
it("does not loop sort strings", () => {

View file

@ -55,7 +55,7 @@ export const pixelUnits = (pixels: number): string => `${pixels}px`;
// If text is wider than the marquee, it needs to loop
export const loopText = (text: string): string =>
isLong(text) ? text + text : text.padEnd(MARQUEE_MAX_LENGTH, " ");
isLong(text) ? `${text} *** ${text}` : text.padEnd(MARQUEE_MAX_LENGTH, " ");
class Marquee extends React.Component<Props, State> {
stepHandle: NodeJS.Timer | null;

View file

@ -324,8 +324,7 @@ export const getMediaText = createSelector(
(minimalMediaText, duration) =>
minimalMediaText == null
? null
: // TODO: Maybe the ` *** ` should actually be added by the marquee
`${minimalMediaText} (${Utils.getTimeStr(duration)}) *** `
: `${minimalMediaText} (${Utils.getTimeStr(duration)})`
);
export const getNumberOfTracks = (state: AppState) =>