diff --git a/lang/en.json b/lang/en.json index 1ffd1ab81..7f8c13657 100644 --- a/lang/en.json +++ b/lang/en.json @@ -198,7 +198,8 @@ "noLauncherUpdateReady": "Metadata update requires a newer Launcher version, but the software update is not currently available.", "deleteView": "Delete Search View", "deleteOnlyBrowseView": "Delete Search View (Must have another custom view)", - "createNewView": "Create new search view" + "createNewView": "Create new search view", + "errorLoadingServices": "An error occurred while loading services. Please check the logs for more details." }, "filter": { "dateAdded": "Date Added", diff --git a/src/back/GameLauncher.ts b/src/back/GameLauncher.ts index 6ee415f5a..6fef00a90 100644 --- a/src/back/GameLauncher.ts +++ b/src/back/GameLauncher.ts @@ -187,7 +187,6 @@ export namespace GameLauncher { // Handle middleware if (launchInfo.activeConfig) { log.info(logSource, `Using Game Configuration: ${launchInfo.activeConfig.name}`); - console.log(JSON.stringify(launchInfo.activeConfig, undefined, 2)); for (const middlewareConfig of launchInfo.activeConfig.middleware) { // Find middleware in registry const middleware = opts.state.registry.middlewares.get(middlewareConfig.middlewareId); diff --git a/src/back/index.ts b/src/back/index.ts index 6bb7f89e2..b2053e98f 100644 --- a/src/back/index.ts +++ b/src/back/index.ts @@ -816,8 +816,9 @@ async function initialize() { state.config, error => { log.info(SERVICES_SOURCE, error.toString()); } ); - } catch (error) { - console.log('Error loading services - ' + error); + } catch (error: any) { + log.error('Back', 'Error loading services - ' + error.toString()); + state.socketServer.broadcast(BackOut.OPEN_ALERT, state.languageContainer.app.errorLoadingServices); } if (state.serviceInfo) { // Run start commands diff --git a/src/back/responses.ts b/src/back/responses.ts index 44a772c6c..ad66603a5 100644 --- a/src/back/responses.ts +++ b/src/back/responses.ts @@ -1359,7 +1359,6 @@ export function registerRequestCallbacks(state: BackState, init: () => Promise { - console.log('finding playlists?'); return filterPlaylists(state.playlists, state.preferences.browsePageShowExtreme); }); diff --git a/src/back/util/search.ts b/src/back/util/search.ts index 8e5681bf2..2ebc914ca 100644 --- a/src/back/util/search.ts +++ b/src/back/util/search.ts @@ -29,7 +29,6 @@ export function createSearchFilter(query: QueryData, preferences: AppPreferences break; } - console.log(`Order by: ${orderBy}`); if (advancedFilter.playlistOrder && playlist !== undefined) { search.order.column = GameSearchSortable.CUSTOM; } else { @@ -112,7 +111,6 @@ export function createSearchFilter(query: QueryData, preferences: AppPreferences newFilter.matchAny = false; newFilter.subfilters = [inner, playlistFilter]; search.filter = newFilter; - console.log(JSON.stringify(search, undefined, 2)); } return { diff --git a/src/renderer/components/DropdownInputField.tsx b/src/renderer/components/DropdownInputField.tsx index 64808ae9f..55c3c61f1 100644 --- a/src/renderer/components/DropdownInputField.tsx +++ b/src/renderer/components/DropdownInputField.tsx @@ -16,6 +16,8 @@ export type DropdownInputFieldProps = InputFieldProps & { onItemSelect?: (text: string, index: number) => void; /** Function for getting a reference to the input element. Called whenever the reference could change. */ inputRef?: RefFunc; + /** Called when the drop-down content is expanded or collapsed. */ + onExpand?: (expanded: boolean) => void; }; type DropdownInputFieldState = { @@ -204,7 +206,12 @@ export class DropdownInputField extends React.Component { if (!this.props.disabled) { - this.setState({ expanded: !this.state.expanded }); + const newExpandedState = !this.state.expanded; + this.setState({ expanded: newExpandedState }, () => { + if (this.props.onExpand) { + this.props.onExpand(newExpandedState); + } + }); } }; diff --git a/src/renderer/components/Footer.tsx b/src/renderer/components/Footer.tsx index bf562e800..2b2422524 100644 --- a/src/renderer/components/Footer.tsx +++ b/src/renderer/components/Footer.tsx @@ -132,13 +132,13 @@ export class Footer extends React.Component { onGlobalKeydown = (event: KeyboardEvent): void => { const scaleDif = 0.1; // How much the scale should change per increase/decrease // Increase Game Scale (CTRL PLUS) - if (event.ctrlKey && event.key === '+') { + if (event.ctrlKey && (event.keyCode === 187 || event.keyCode === 61 || event.keyCode === 171)) { const scale = this.props.preferencesData.browsePageGameScale; this.setScaleSliderValue(scale + scaleDif); event.preventDefault(); } // Decrease Game Scale (CTRL MINUS) - else if (event.ctrlKey && event.key === '-') { + else if (event.ctrlKey && (event.keyCode === 189 || event.keyCode === 173)) { const scale = this.props.preferencesData.browsePageGameScale; this.setScaleSliderValue(scale - scaleDif); event.preventDefault(); @@ -152,8 +152,9 @@ export class Footer extends React.Component { */ setScaleSliderValue(scale: number): void { if (this.scaleSliderRef.current) { - const value = Math.min(Math.max(0, scale), 1) * Footer.scaleSliderMax; - this.scaleSliderRef.current.value = value + ''; + if (scale < 0) { scale = 0; } + else if (scale > 1) { scale = 1; } + this.scaleSliderRef.current.value = (Math.min(Math.max(0, scale), 1) * Footer.scaleSliderMax).toFixed(1).toString(); updatePreferencesData({ browsePageGameScale: scale }); } } diff --git a/src/renderer/components/RightBrowseSidebar.tsx b/src/renderer/components/RightBrowseSidebar.tsx index 8439bba6f..626c9d375 100644 --- a/src/renderer/components/RightBrowseSidebar.tsx +++ b/src/renderer/components/RightBrowseSidebar.tsx @@ -852,6 +852,7 @@ export class RightBrowseSidebar extends React.Component this.props.onEditGame({ legacyApplicationPath: text })} /> @@ -969,6 +970,15 @@ export class RightBrowseSidebar extends React.Component { + if (this.state.middleScrollRef.current) { + this.state.middleScrollRef.current.scrollTo({ + top: this.state.middleScrollRef.current.scrollHeight, + behavior: 'smooth' + }); + } + } + renderDeleteGameButton({ confirm, extra }: ConfirmElementArgs): JSX.Element { return (
{ } onDatabaseLoaded() { - console.log('db load'); window.Shared.back.request(BackIn.GET_PLAYLISTS) .then(data => { - console.log('got playlists'); if (data) { this.props.mainActions.addLoaded([BackInit.PLAYLISTS]); this.props.setMainState({ playlists: data }); @@ -316,7 +314,6 @@ export class App extends React.Component { } this.props.setTagCategories(data.tagCategories); - console.log('navigating to ' + this.props.preferencesData.defaultOpeningPage); this.props.history.push(this.props.preferencesData.defaultOpeningPage); }) .then(() => { diff --git a/src/renderer/components/pages/ConfigPage.tsx b/src/renderer/components/pages/ConfigPage.tsx index cc363e2bc..cdad9f805 100644 --- a/src/renderer/components/pages/ConfigPage.tsx +++ b/src/renderer/components/pages/ConfigPage.tsx @@ -723,8 +723,6 @@ export class ConfigPage extends React.Component): JSX.Element[] => { const allStrings = this.context; return extensions.map((ext) => { - console.log(fpfssConsents); - const fpfssConsent = fpfssConsents[ext.id]; const shortContribs = []; diff --git a/src/shared/lang.ts b/src/shared/lang.ts index 41a724948..1dde31a75 100644 --- a/src/shared/lang.ts +++ b/src/shared/lang.ts @@ -206,6 +206,7 @@ const langTemplate = { 'deleteView', 'deleteOnlyBrowseView', 'createNewView', + 'errorLoadingServices', ] as const, filter: [ 'dateAdded',