Skip to content

Commit 4b5918b

Browse files
committed
fix: Wrap rest of sidebar search fields in quotes
fix: Pathing issue when resolving data pack in makeCurationFromGame fix: Make context menu use same code as right sidebar for initiating fpfss edits fix: Remove outdated http proxying rules getting in the way of local fpfss dev
1 parent e8a1050 commit 4b5918b

5 files changed

Lines changed: 22 additions & 14 deletions

File tree

src/back/curate/util.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ export async function makeCurationFromGame(state: BackState, gameId: string, ski
378378
const activeData = await fpDatabase.findGameDataById(game.activeDataId);
379379
if (activeData && activeData.presentOnDisk && !skipDataPack) {
380380
// Extract data pack into curation folder
381-
const dataPath = getGameDataFilename(activeData);
381+
const dataPath = path.join(state.config.flashpointPath, state.preferences.dataPacksFolderPath, getGameDataFilename(activeData));
382382
await extractFullPromise([dataPath, curPath, { $bin: state.sevenZipPath }]);
383383
// Clean up content.json file from extracted data pack
384384
await fs.unlink(path.join(curPath, 'content.json'))

src/back/sync.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ export async function syncPlatforms(source: GameMetadataSource): Promise<Date> {
4646

4747
const res = await axios.get(platformsUrl)
4848
.catch((err) => {
49-
throw 'Failed to search platforms';
49+
console.log(err);
50+
throw `Failed to search platforms - ${err}`;
5051
});
5152

5253
const platforms = (res.data as RemotePlatformRaw[]).map<RemotePlatform>((v) => {

src/main/Main.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ export function main(init: Init): void {
378378
)
379379
)
380380
);
381-
if (!allow && !Util.isDev) {
381+
if (Util.isDev ? false : !allow) {
382382
console.log(`Request Denied to ${url?.hostname || remoteHostname}`);
383383
}
384384

@@ -428,11 +428,6 @@ export function main(init: Init): void {
428428
}
429429
});
430430

431-
webContents.session.setProxy({
432-
proxyRules: 'http=localhost:22500;direct://',
433-
proxyBypassRules: '<local>,*.unstable.life,*.flashpointarchive.org',
434-
});
435-
436431
function onNewPage(navigationUrl: string): void {
437432
shell.openExternal(navigationUrl);
438433
}

src/renderer/components/GameComponents.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export function GameComponentSeries(props: GameComponentProps) {
4848
header={lang.browse.series}
4949
text={series}
5050
placeholder={lang.browse.noSeries}
51-
onClick={() => { if (!editable) { doSearch(`series=${series}`); }}}
51+
onClick={() => { if (!editable) { doSearch(`series="${series}"`); }}}
5252
onChange={(value) => updateGame({ series: value })}
5353
{...props} />;
5454
}
@@ -62,7 +62,7 @@ export function GameComponentPublisher(props: GameComponentProps) {
6262
header={lang.browse.publisher}
6363
text={publisher}
6464
placeholder={lang.browse.noPublisher}
65-
onClick={() => { if (!editable) { doSearch(`publisher=${publisher}`); }}}
65+
onClick={() => { if (!editable) { doSearch(`publisher="${publisher}"`); }}}
6666
onChange={(value) => updateGame({ publisher: value })}
6767
{...props} />;
6868
}
@@ -102,7 +102,7 @@ export function GameComponentLanguage(props: GameComponentProps) {
102102
header={lang.browse.language}
103103
text={language}
104104
placeholder={lang.browse.noLanguage}
105-
onClick={() => { if (!editable) { doSearch(`language=${language}`); }}}
105+
onClick={() => { if (!editable) { doSearch(`language="${language}"`); }}}
106106
onChange={(value) => updateGame({ language: value })}
107107
{...props} />;
108108
}
@@ -121,7 +121,7 @@ export function GameComponentPlayMode(props: GameComponentProps) {
121121
onChange={(event) => updateGame({ playMode: event.currentTarget.value })}
122122
className='browse-right-sidebar__searchable'
123123
editable={editable}
124-
onClick={() => { if (!editable) { doSearch(`playMode=${playMode}`); }}}
124+
onClick={() => { if (!editable) { doSearch(`playMode="${playMode}"`); }}}
125125
items={suggestions && filterSuggestions(suggestions.playMode) || []}
126126
onItemSelect={text => updateGame({ playMode: text })} />
127127
</div>
@@ -142,7 +142,7 @@ export function GameComponentStatus(props: GameComponentProps) {
142142
onChange={(event) => updateGame({ status: event.currentTarget.value })}
143143
className='browse-right-sidebar__searchable'
144144
editable={editable}
145-
onClick={() => { if (!editable) { doSearch(`status=${status}`); }}}
145+
onClick={() => { if (!editable) { doSearch(`status="${status}"`); }}}
146146
items={suggestions && filterSuggestions(suggestions.status) || []}
147147
onItemSelect={text => updateGame({ status: text })} />
148148
</div>

src/renderer/context/MenuContext.tsx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { createErrorDialogWithPrefix, createNewDialog } from '@renderer/dialog';
33
import { useAppDispatch, useAppSelector } from '@renderer/hooks/useAppSelector';
44
import { useLocalization } from '@renderer/hooks/useLocalization';
55
import { setCurrentCuration } from '@renderer/store/curate/slice';
6+
import { createFpfssEditGame } from '@renderer/store/fpfss/slice';
67
import { getGameImagePath, getGameImageURL, getGamePath, openUrlInWindow } from '@renderer/Util';
78
import { BackIn } from '@shared/back/types';
89
import { Paths } from '@shared/Paths';
@@ -11,6 +12,7 @@ import { DialogStateTemplate, LangContainer, Playlist } from 'flashpoint-launche
1112
import { MenuContextStateProps, MenuItemType } from 'flashpoint-launcher-renderer';
1213
import React, { createContext, useEffect, useRef, useState } from 'react';
1314
import { useNavigate } from 'react-router-dom';
15+
import { toast } from 'react-toastify';
1416

1517
export const defaultMenuWidth = 230;
1618
export const menuDefHeight = 26;
@@ -56,7 +58,17 @@ export function MenuProvider({ children }: MenuContextProps) {
5658
label: strings.browse.editFpfssGame,
5759
enabled: enableEditing,
5860
onClick: () => {
59-
// this.onFpfssEditGame(gameId);
61+
dispatch(createFpfssEditGame(gameId)).unwrap()
62+
.then(() => {
63+
navigate(Paths.FPFSS + '/' + gameId);
64+
})
65+
.catch((error) => {
66+
log.error('FPFSS', error.message);
67+
toast(error.message, {
68+
type: 'error',
69+
autoClose: false
70+
});
71+
});
6072
}
6173
},
6274
{

0 commit comments

Comments
 (0)