Skip to content

Commit

Permalink
fix: disable useless second stats panel on ios
Browse files Browse the repository at this point in the history
  • Loading branch information
zardoy committed Mar 21, 2024
1 parent 64f16cb commit dba4043
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
5 changes: 4 additions & 1 deletion src/flyingSquidEvents.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import { showModal } from './globalState'
import { chatInputValueGlobal } from './react/ChatContainer'
import { showNotification } from './react/NotificationProvider'

export default () => {
localServer!.on('warpsLoaded', () => {
showNotification(`${localServer!.warps.length} Warps loaded`, 'Use /warp <name> to teleport to a warp point.', false, 'label-alt', () => {
// todo open warp command
chatInputValueGlobal.value = '/warp '
showModal({ reactType: 'chat' })
})
})
}
3 changes: 1 addition & 2 deletions src/react/ChatContainer.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { proxy, subscribe, useSnapshot } from 'valtio'
import { proxy, subscribe } from 'valtio'
import { useEffect, useMemo, useRef, useState } from 'react'
import { isCypress } from '../standaloneUtils'
import { MessageFormatPart } from '../botUtils'
import { miscUiState } from '../globalState'
import { MessagePart } from './MessageFormatted'
import './ChatContainer.css'
import { isIos } from './utils'
Expand Down
4 changes: 0 additions & 4 deletions src/react/OptionsRenderApp.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
import { useSnapshot } from 'valtio'
import { activeModalStack, hideCurrentModal } from '../globalState'
import { OptionsGroupType } from '../optionsGuiScheme'
import { uniqueFileNameFromWorldName, copyFilesAsyncWithProgress } from '../browserfs'
import { fsState } from '../loadSave'
import Button from './Button'
import OptionsGroup from './OptionsGroup'
import { showOptionsModal } from './SelectOption'

export default () => {
const { reactType } = useSnapshot(activeModalStack).at(-1) ?? {}
Expand Down
5 changes: 4 additions & 1 deletion src/topRightStats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { isCypress } from './standaloneUtils'

const stats = new Stats()
const stats2 = new Stats()
const hasRamPanel = stats2.dom.children.length === 3
const statsGl = new StatsGl({ minimal: true })
// in my case values are good: gpu: < 0.5, cpu < 0.15

Expand Down Expand Up @@ -34,7 +35,9 @@ const addStatsGlStat = (canvas) => {
addStat(container)
}
addStat(stats.dom)
addStat(stats2.dom)
if (hasRamPanel) {
addStat(stats2.dom)
}

const hideStats = localStorage.hideStats || isCypress()
if (hideStats) {
Expand Down

0 comments on commit dba4043

Please sign in to comment.