-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Fix] open overlay for epic forwarder listings (#977)
* open overlay for epic forwarder listings * fix time for epic forwarder listings * bump 0.17.1
- Loading branch information
1 parent
632525a
commit 17f3f42
Showing
6 changed files
with
74 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { getHyperPlayNameToReleaseMap } from 'backend/storeManagers/hyperplay/utils' | ||
import { GameInfo } from 'common/types' | ||
|
||
export async function gameIsEpicForwarderOnHyperPlay(gameInfo: GameInfo) { | ||
const gameNameMap = await getHyperPlayNameToReleaseMap() | ||
let hyperPlayListing = undefined | ||
const gameInfoTitle = gameInfo.title.toLowerCase() | ||
const gameIsEpicForwarderOnHP = | ||
gameInfo.runner === 'legendary' && gameNameMap.has(gameInfoTitle) | ||
if (gameIsEpicForwarderOnHP) { | ||
hyperPlayListing = gameNameMap.get(gameInfoTitle) | ||
} | ||
return { gameIsEpicForwarderOnHP, hyperPlayListing } | ||
} | ||
|
||
export async function launchingGameShouldOpenOverlay(gameInfo?: GameInfo) { | ||
if (!gameInfo) { | ||
return { shouldOpenOverlay: false } | ||
} | ||
const { gameIsEpicForwarderOnHP, hyperPlayListing } = | ||
await gameIsEpicForwarderOnHyperPlay(gameInfo) | ||
const gameIsDirectOnHyperPlay = gameInfo.runner === 'hyperplay' | ||
const gameIsSideloadedWithWeb3 = | ||
gameInfo.runner === 'sideload' && !!gameInfo.web3?.supported | ||
return { | ||
shouldOpenOverlay: | ||
gameIsEpicForwarderOnHP || | ||
gameIsDirectOnHyperPlay || | ||
gameIsSideloadedWithWeb3, | ||
gameIsEpicForwarderOnHP, | ||
hyperPlayListing | ||
} | ||
} |