Skip to content

Commit

Permalink
fix: Hall of Fame link on Home Page
Browse files Browse the repository at this point in the history
fix: Manual directs to /manual (help)
  • Loading branch information
colin969 committed Aug 2, 2022
1 parent 45686f4 commit 55a46a5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
1 change: 1 addition & 0 deletions src/renderer/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1038,6 +1038,7 @@ export class App extends React.Component<AppProps> {
rollRandomGames: this.rollRandomGames,
updateView: this.updateView,
gamesTotal: view && view.total,
allPlaylists: this.props.main.playlists,
playlists: playlists,
suggestions: this.props.main.suggestions,
appPaths: this.props.main.appPaths,
Expand Down
11 changes: 3 additions & 8 deletions src/renderer/components/pages/HomePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { updatePreferencesData } from '@shared/preferences/util';
import { getUpgradeString } from '@shared/upgrade/util';
import { formatString } from '@shared/utils/StringFormatter';
import { AppUpdater, UpdateInfo } from 'electron-updater';
import * as path from 'path';
import * as React from 'react';
import ReactMarkdown from 'react-markdown';
import { Link } from 'react-router-dom';
Expand Down Expand Up @@ -97,12 +96,8 @@ export function HomePage(props: HomePageProps) {
props.onLaunchGame(gameId);
}, [props.onLaunchGame]);

const onHelpClick = React.useCallback(() => {
remote.shell.openPath(path.join(window.Shared.config.fullFlashpointPath, 'Manual.pdf'));
}, [window.Shared.config.fullFlashpointPath]);

const onHallOfFameClick = React.useCallback(() => {
const playlist = props.playlists.find(p => p.title === 'Flashpoint Hall of Fame');
const playlist = props.playlists.find(p => p.title.toLowerCase().includes('hall of fame'));
if (playlist) {
props.onSelectPlaylist(ARCADE, playlist.id);
props.clearSearch();
Expand Down Expand Up @@ -248,7 +243,7 @@ export function HomePage(props: HomePageProps) {
{formatString(strings.configInfo, <Link to={Paths.CONFIG}>{strings.config}</Link>)}
</QuickStartItem>
<QuickStartItem icon='info'>
{formatString(strings.helpInfo, <Link to='#' onClick={onHelpClick}>{strings.help}</Link>)}
{formatString(strings.helpInfo, <Link to={Paths.MANUAL}>{strings.help}</Link>)}
</QuickStartItem>
</>
);
Expand All @@ -261,7 +256,7 @@ export function HomePage(props: HomePageProps) {
{render}
</HomePageBox>
);
}, [strings, onHallOfFameClick, onAllGamesClick, onAllAnimationsClick, onHelpClick, props.preferencesData.minimizedHomePageBoxes, toggleMinimizeBox]);
}, [strings, onHallOfFameClick, onAllGamesClick, onAllAnimationsClick, props.preferencesData.minimizedHomePageBoxes, toggleMinimizeBox]);

const renderedExtras = React.useMemo(() => {
const render = (
Expand Down
3 changes: 2 additions & 1 deletion src/renderer/router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export type AppRouterProps = {
randomGames: ViewGame[];
rollRandomGames: () => void;
gamesTotal?: number;
allPlaylists: Playlist[];
playlists: Playlist[];
suggestions: Partial<GamePropSuggestions>;
appPaths: Record<string, string>;
Expand Down Expand Up @@ -84,7 +85,7 @@ export class AppRouter extends React.Component<AppRouterProps> {
render() {
const homeProps: ConnectedHomePageProps = {
platforms: this.props.platforms,
playlists: this.props.playlists,
playlists: this.props.allPlaylists,
upgrades: this.props.upgrades,
onGameContextMenu: this.props.onGameContextMenu,
onSelectPlaylist: this.props.onSelectPlaylist,
Expand Down

0 comments on commit 55a46a5

Please sign in to comment.