Skip to content

Commit e93d264

Browse files
committed
replace device with platform
1 parent 703f7b9 commit e93d264

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
"electron:build:mac": "npm run electron:build:assets && electron-builder --mac",
8484
"electron:build:linux": "npm run electron:build:assets && electron-builder --linux",
8585
"cap:copy": "mkdir -p dist-cap && cp -r Pictures translations dist Synergism.css index.html dist-cap/",
86-
"cap:build": "npm run build:esbuild -- --define:DEVICE=\\\"'mobile'\\\" && npm run cap:copy && npx cap sync",
86+
"cap:build": "npm run build:esbuild -- --define:PLATFORM=\\\"mobile\\\" && npm run cap:copy && npx cap sync",
8787
"cap:generate:assets": "npx @capacitor/assets generate --ios --android",
8888
"cap:open:ios": "npx cap open ios"
8989
},

src/Config.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
declare const PROD: boolean | undefined
22
declare const DEV: boolean | undefined
3-
declare const PLATFORM: 'steam' | undefined
4-
declare const DEVICE: 'mobile' | undefined
3+
declare const PLATFORM: 'steam' | 'mobile' | undefined
54

65
export const version = '4.1.1 December 17, 2025: The Ants Update'
76

@@ -15,4 +14,3 @@ export const prod = typeof PROD === 'undefined' ? false : PROD
1514
export const dev = typeof DEV === 'undefined' ? false : DEV
1615

1716
export const platform = typeof PLATFORM === 'undefined' ? 'browser' : PLATFORM
18-
export const device = typeof DEVICE === 'undefined' ? 'browser' : DEVICE

src/Login.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import i18next from 'i18next'
55
import { z } from 'zod'
66
import { DOMCacheGetOrSet } from './Cache/DOM'
77
import { calculateAmbrosiaGenerationSpeed, calculateOffline, calculateRedAmbrosiaGenerationSpeed } from './Calculate'
8-
import { dev, device, platform } from './Config'
8+
import { platform } from './Config'
99
import { updateGlobalsIsEvent } from './Event'
1010
import { addTimers, automaticTools } from './Helper'
1111
import { exportData, importSynergism, saveFilename } from './ImportExport'
@@ -298,15 +298,15 @@ async function fetchMeRoute () {
298298

299299
// Build headers - include token for mobile auth
300300
const headers: HeadersInit = {}
301-
if (device === 'mobile') {
301+
if (platform === 'mobile') {
302302
const token = localStorage.getItem('synergism_token')
303303
if (token) {
304304
headers.Authorization = `Bearer ${token}`
305305
}
306306
}
307307

308308
return await fetch('https://synergism.cc/api/v1/users/me', {
309-
credentials: device === 'browser' ? 'same-origin' : undefined,
309+
credentials: platform === 'browser' ? 'same-origin' : undefined,
310310
headers
311311
}).catch(() => fallback)
312312
}
@@ -337,7 +337,7 @@ export async function handleLogin () {
337337
loggedIn = hasAccount(account)
338338
subscription = sub
339339

340-
if (location.hostname !== 'synergism.cc' && platform === 'browser' && device === 'browser') {
340+
if (location.hostname !== 'synergism.cc' && platform === 'browser') {
341341
subtabElement.innerHTML =
342342
'Login is not available here, go to <a href="https://synergism.cc">https://synergism.cc</a> instead!'
343343
} else if (hasAccount(account)) {
@@ -557,7 +557,7 @@ export async function handleLogin () {
557557
eventBonusesChevron.style.transform = isCollapsed ? 'rotate(0deg)' : 'rotate(-90deg)'
558558
})
559559
} else if (!hasAccount(account)) {
560-
if (device !== 'mobile') {
560+
if (platform !== 'mobile') {
561561
// User is not logged in
562562
subtabElement.querySelector('#open-register')?.addEventListener('click', () => {
563563
subtabElement.querySelector<HTMLElement>('#register')?.style.setProperty('display', 'flex')
@@ -864,7 +864,7 @@ export const renderCaptcha = platform === 'steam'
864864
* Sign in with Apple
865865
*/
866866
export async function signInWithApple (): Promise<void> {
867-
if (device !== 'mobile') {
867+
if (platform !== 'mobile') {
868868
return
869869
}
870870

0 commit comments

Comments
 (0)