Skip to content

Commit

Permalink
fix warps display for greenfield & click action
Browse files Browse the repository at this point in the history
  • Loading branch information
zardoy committed Mar 25, 2024
1 parent 501d353 commit 6997e78
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
6 changes: 4 additions & 2 deletions src/loadSave.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { proxy } from 'valtio'
import { gzip } from 'node-gzip'
import { options } from './optionsStorage'
import { nameToMcOfflineUUID, disconnect } from './flyingSquidUtils'
import { forceCachedDataPaths, forceRedirectPaths, mkdirRecursive } from './browserfs'
import { existsViaStats, forceCachedDataPaths, forceRedirectPaths, mkdirRecursive } from './browserfs'
import { isMajorVersionGreater } from './utils'

import { activeModalStacks, insertActiveModalStack, miscUiState } from './globalState'
Expand Down Expand Up @@ -154,7 +154,9 @@ export const loadSave = async (root = '/world') => {
// improve compatibility with community saves
const rootRemapFiles = ['Warp files']
for (const rootRemapFile of rootRemapFiles) {
forceRedirectPaths[path.join(root, rootRemapFile)] = path.join(root, '..', rootRemapFile)
if (await existsViaStats(path.join(root, '..', rootRemapFile))) {
forceRedirectPaths[path.join(root, rootRemapFile)] = path.join(root, '..', rootRemapFile)
}
}

// todo reimplement
Expand Down
4 changes: 2 additions & 2 deletions src/react/Notification.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default ({ type = 'message', message, subMessage = '', open, icon = '', a
position: 'fixed',
top: 0,
right: 0,
width: '160px',
width: '155px',
whiteSpace: 'nowrap',
fontSize: '9px',
display: 'flex',
Expand All @@ -45,7 +45,7 @@ export default ({ type = 'message', message, subMessage = '', open, icon = '', a
padding: '3px 8px',
background: isError ? 'rgba(255, 0, 0, 0.7)' : 'rgba(0, 0, 0, 0.7)',
borderRadius: '0 0 0 5px',
pointerEvents: action ? 'auto' : 'none',
pointerEvents: action ? '' : 'none',
zIndex: 1200, // even above stats
...addStyles
}}>
Expand Down
3 changes: 2 additions & 1 deletion src/react/NotificationProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export const hideNotification = () => {
}

export default () => {
const { autoHide, message, open, icon, type, subMessage } = useSnapshot(notificationProxy)
const { autoHide, message, open, icon, type, subMessage, action } = useSnapshot(notificationProxy)

useEffect(() => {
if (autoHide && open) {
Expand All @@ -58,6 +58,7 @@ export default () => {
// }, [])

return <Notification
action={action}
type={type}
message={message}
subMessage={subMessage}
Expand Down

0 comments on commit 6997e78

Please sign in to comment.