Skip to content
This repository has been archived by the owner on Jan 3, 2023. It is now read-only.

Commit

Permalink
Fix bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
ShirasawaSama committed Apr 3, 2020
1 parent e870194 commit 82ea8a7
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 33 deletions.
22 changes: 0 additions & 22 deletions azure-pipelines.yml

This file was deleted.

4 changes: 2 additions & 2 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,13 @@ const App: React.FC = () => {
<Router ref={ref as any} history={history}>
<SideBar />
<section id='main-content' className='scrollable'>
<LiveRoute exact component={Home} path='/' />
{!(window as any).__indexUrl && <LiveRoute exact component={Home} path='/' />}
<LiveRoute component={Manager} path='/manager/:type' className='vh100' />
<LiveRoute exact component={Settings} path='/settings' />
<LiveRoute exact component={ErrorPage} path='/error' className='vh100' />
<LiveRoute exact component={ServerHome} path='/serverHome' className='vh100' />
<Route component={CustomServerHome} path='/customServerHome' className='vh100' />
<Redirect to='/' />
<Redirect to={(window as any).__indexUrl || '/'} />
<PluginRoutes />
</section>
</Router>
Expand Down
4 changes: 3 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,10 @@ const create = () => {
createServer(window)
}

if (process.platform === 'linux') app.commandLine.appendSwitch('enable-transparent-visuals')

app
.on('ready', create)
.on('ready', process.platform === 'linux' ? () => setTimeout(create, 400) : create)
.on('before-quit', () => runBeforeQuit && runBeforeQuit.length && spawn.apply(null, runBeforeQuit)
.once('error', console.error).unref())
.on('quit', () => setTimeout(() => app.exit(), 1500))
Expand Down
2 changes: 1 addition & 1 deletion src/models/ProfilesStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ export default class ProfilesStore extends Store {
title: $('Locate Java'),
message: $('Locate the path of Java 8'),
filters: [
{ name: $('Executable File (Javaw)'), extensions: process.platform === 'win32' ? ['exe'] : [] }
{ name: $('Executable File (Javaw)'), extensions: process.platform === 'win32' ? ['exe'] : [''] }
]
})
if (ret.canceled) return
Expand Down
2 changes: 1 addition & 1 deletion src/plugin/internal/ResourceInstaller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ interface DownloadAndMoveOption extends DownloadOption {

const downloadAndGetHash = (options: DownloadOption | DownloadOption[]) => download(options).then(() => {
const files = Array.isArray(options) ? options : [options]
return files[0]?.checksum ? pAll(files.map(it => () => sha1(it.destination)), { concurrency: 8 }) : undefined
return files[0]?.checksum ? undefined : pAll(files.map(it => () => sha1(it.destination)), { concurrency: 8 })
})

@plugin({
Expand Down
2 changes: 1 addition & 1 deletion src/protocol/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const handleMessage = async (data: T.Protocol) => {
currentWindow.restore()
currentWindow.setAlwaysOnTop(true)
currentWindow.setAlwaysOnTop(false)
}
} else pluginMaster.emit('protocol', data)
} catch (e) {
console.error(e)
}
Expand Down
5 changes: 3 additions & 2 deletions src/routes/CustomServerHome.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ import { queryStatus } from '@xmcl/client'
const style = {
position: 'absolute' as 'absolute',
left: 192,
right: 0,
right: -10,
bottom: 0,
top: 0
}
const ServerHome: React.FC = () => {
const src = useLocation().search.replace(/^\?/, '')
let src = useLocation().search.replace(/^\?/, '')
if (!src) return null
src = decodeURIComponent(src)
const ref = useRef<E.WebviewTag>()
const w = ref.current
useLayoutEffect(() => {
Expand Down
7 changes: 4 additions & 3 deletions src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,8 @@ export const vertifyJava = async (version: [string, boolean], dialog = false) =>
const locateJavaAsync: (options: ILocateJavaHomeOptions) => Promise<IJavaHomeInfo[] | null> = promisify(locateJava)
export const findJavaPath = async () => {
const ext = process.platform === 'win32' ? '.exe' : ''
const name = 'bin/javaw' + ext
const baseName = (process.platform === 'linux' ? 'java' : 'javaw') + ext
const name = 'bin/' + baseName
let path = join(getSelfInstalledJavaPath(), name)
if (await pathExists(path)) return path
const arch = isX64() ? '64' : '86'
Expand All @@ -271,9 +272,9 @@ export const findJavaPath = async () => {
break
}
if (await pathExists(path)) return path
const version = await getJavaVersion('javaw' + ext)
const version = await getJavaVersion(baseName)
if (version && await vertifyJava(version)) {
path = await which('javaw' + ext).catch(console.error)
path = await which(baseName).catch(console.error)
if (path) return path
}
const java = await locateJavaAsync({ version: '~1.8', mustBe64Bit: isX64(), paranoid: true }).catch(console.error)
Expand Down

0 comments on commit 82ea8a7

Please sign in to comment.