Skip to content

Commit 5fdcdf5

Browse files
committed
Merge branch 'main' of github.com:HyperPlay-Gaming/hyperplay-desktop-client into feat/steam_runner
2 parents d3eefa3 + 0fdc160 commit 5fdcdf5

File tree

26 files changed

+378
-124
lines changed

26 files changed

+378
-124
lines changed

index.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
33
<head>
44
<meta charset="UTF-8" />
55
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6-
<meta http-equiv="Content-Security-Policy" content="script-src 'self';" />
6+
<meta
7+
http-equiv="Content-Security-Policy"
8+
content="script-src 'self' https://static.zdassets.com https://*.zendesk.com;"
9+
/>
710
<title>HyperPlay</title>
811
<script type="module" src="/src/frontend/index.tsx"></script>
912
</head>

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "hyperplay",
3-
"version": "0.29.1",
3+
"version": "0.30.2",
44
"private": true,
55
"main": "build/main/main.js",
66
"homepage": "./",
@@ -72,7 +72,7 @@
7272
"@hyperplay/chains": "^0.6.1",
7373
"@hyperplay/check-disk-space": "^3.5.2",
7474
"@hyperplay/quests-ui": "^0.4.0",
75-
"@hyperplay/ui": "^1.30.3",
75+
"@hyperplay/ui": "^1.32.1",
7676
"@hyperplay/utils": "^0.3.14",
7777
"@mantine/carousel": "^7.12.0",
7878
"@mantine/core": "^7.12.0",
@@ -86,6 +86,7 @@
8686
"@shockpkg/icon-encoder": "^2.1.3",
8787
"@tanstack/query-core": "^5.80.7",
8888
"@tanstack/react-query": "^5.80.7",
89+
"@typeform/embed-react": "^4.6.0",
8990
"@valist/sdk": "^2.10.14",
9091
"@wagmi/core": "2.15.2",
9192
"auto-launch": "^5.0.6",

pnpm-lock.yaml

Lines changed: 29 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/locales/en/translation.json

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -473,18 +473,21 @@
473473
"useRecoveryPhraseInfo": "This feature is recommended for advanced users and developers. Your secret recovery phrase is stored locally in MetaMask and never shared with HyperPlay."
474474
},
475475
"info": {
476-
"createWalletCTA": "Create a wallet",
477-
"createWalletDescription": "Click in “Create a wallet” below if you do not have a wallet or want to create a new one:",
478476
"digitalAssets": {
479-
"details": "Wallets are used to send, receive, store, and display digital assets like tokens and NFTs.",
480-
"title": "A Home for your Digital Assets"
477+
"smallTitle": "Connect your wallet to activate powerful features:"
481478
},
482-
"login": {
483-
"details": "An alternative to creating new accounts and passwords on every website, just connect your wallet instead.",
484-
"title": "A New Way to Log In"
485-
},
486-
"skip": "Skip for now",
487-
"title": "What is a wallet?"
479+
"list": {
480+
"bullet1": "Earn and claim quest rewards",
481+
"bullet2": "Track your in-game progress",
482+
"bullet3": "Access in-game transactions and marketplaces",
483+
"bullet4": "Buy, swap, and send tokens"
484+
}
485+
},
486+
"metamask": {
487+
"issues": "Having issues? Make sure MetaMask is up to date."
488+
},
489+
"newInfo": {
490+
"title": "Don't Just Play-Get Rewarded"
488491
},
489492
"scan": {
490493
"details": "Create an encrypted communication channel. Your keys will never be shared with HyperPlay.",

src/backend/api/misc.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,3 +238,7 @@ export const isClientUpdating = async () =>
238238
ipcRenderer.invoke('isClientUpdating')
239239

240240
export const restartClient = () => ipcRenderer.send('restartClient')
241+
242+
export const shouldPromptNps = async () => ipcRenderer.invoke('shouldPromptNps')
243+
244+
export const npsSubmitted = () => ipcRenderer.send('npsSubmitted')

src/backend/constants.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ const fontsStore = new TypeCheckedStoreBackend('fontsStore', {
3535
name: 'fonts'
3636
})
3737

38+
const npsStore = new TypeCheckedStoreBackend('npsStore', {
39+
cwd: 'store',
40+
name: 'nps'
41+
})
42+
3843
const isMac = platform() === 'darwin'
3944
const isWindows = platform() === 'win32'
4045
const isLinux = platform() === 'linux'
@@ -300,5 +305,6 @@ export {
300305
vulkanHelperBin,
301306
cachedUbisoftInstallerPath,
302307
ipdtManifestsPath,
303-
ipdtPatcher
308+
ipdtPatcher,
309+
npsStore
304310
}

src/backend/ipcHandlers/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ import './checkDiskSpace'
33
import './auth'
44
import './mods'
55
import './importGameFolder'
6+
import './nps'

src/backend/ipcHandlers/nps.ts

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import { npsStore } from 'backend/constants'
2+
import { app, ipcMain } from 'electron'
3+
import { major } from 'semver'
4+
5+
let npsAlreadyPromptedForThisSession = false
6+
7+
ipcMain.on('npsSubmitted', () => {
8+
npsStore.set('lastClientVersionNpsSubmitted', app.getVersion())
9+
})
10+
11+
ipcMain.handle('shouldPromptNps', async () => {
12+
const lastAppVersion = npsStore.get('lastClientVersionNpsSubmitted', '0.0.0')
13+
const currentAppVersion = app.getVersion()
14+
15+
const userHasNeverBeenPrompted = lastAppVersion === '0.0.0'
16+
if (userHasNeverBeenPrompted) {
17+
return true
18+
}
19+
const haveNotPromptedUserOnThisMajorVersion =
20+
major(lastAppVersion) < major(currentAppVersion)
21+
22+
if (
23+
haveNotPromptedUserOnThisMajorVersion &&
24+
!npsAlreadyPromptedForThisSession
25+
) {
26+
npsAlreadyPromptedForThisSession = true
27+
return true
28+
}
29+
return false
30+
})

src/common/typedefs/ipcBridge.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ interface HyperPlaySyncIPCFunctions {
102102
authDisconnected: () => void
103103
otp: (otp: string) => void
104104
navigate: (route: string) => void
105+
npsSubmitted: () => void
105106
}
106107

107108
interface SyncIPCFunctions extends HyperPlaySyncIPCFunctions {
@@ -343,6 +344,7 @@ interface HyperPlayAsyncIPCFunctions {
343344
walletAddress: string
344345
}
345346
} | null>
347+
shouldPromptNps: () => Promise<boolean>
346348
}
347349

348350
interface AsyncIPCFunctions extends HyperPlayAsyncIPCFunctions {

src/common/types/electron_store.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,9 @@ export interface StoreStructure {
111111
subscribed: boolean
112112
skipped: boolean
113113
}
114+
npsStore: {
115+
lastClientVersionNpsSubmitted: string
116+
}
114117
}
115118

116119
export type StoreOptions<T extends Record<string, unknown>> = Store.Options<T>

0 commit comments

Comments
 (0)