Skip to content

Commit b478138

Browse files
committed
Fix sharing generic statistics
1 parent 5602de1 commit b478138

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/menu/internal/share.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ type InfoShareRecord = {
7474
data: Record<string, unknown>
7575
theme: ThemeName
7676
when: Date
77+
gamemode?: undefined
7778
}
7879

7980
/** Keep in sync with Go's share.Record */
@@ -99,7 +100,7 @@ export async function getShareContent(
99100
{ record, location: { protocol, host } }: ShareContentParams,
100101
validSession: boolean
101102
): Promise<ShareData> {
102-
if (!('gamemode' in record)) {
103+
if (!('gamemode' in record) || !record.gamemode) {
103104
const [[key, value]] = entries(record.data)
104105

105106
return {
@@ -153,7 +154,7 @@ export async function getShareContent(
153154
text = 'Do you have the fastest fingers in the world? Or at least faster than mine?'
154155
break
155156
default:
156-
throw new UnreachableError(record.gamemode, 'unimplemented gamemode')
157+
throw new UnreachableError(record, 'unimplemented gamemode')
157158
}
158159

159160
return {

0 commit comments

Comments
 (0)