mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-24 02:20:13 +01:00
🎨 Smoother launch screen on desktop https://github.com/siyuan-note/siyuan/issues/8596
This commit is contained in:
parent
ee69dc6742
commit
bb5150c8d4
2 changed files with 20 additions and 2 deletions
|
|
@ -33,6 +33,23 @@
|
||||||
const sleep = (ms) => {
|
const sleep = (ms) => {
|
||||||
return new Promise(resolve => setTimeout(resolve, ms))
|
return new Promise(resolve => setTimeout(resolve, ms))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const getSearch = (key) => {
|
||||||
|
if (window.location.search.indexOf('?') === -1) {
|
||||||
|
return ''
|
||||||
|
}
|
||||||
|
let value = ''
|
||||||
|
const data = window.location.search.split('?')[1].split('&')
|
||||||
|
data.find(item => {
|
||||||
|
const keyValue = item.split('=')
|
||||||
|
if (keyValue[0] === key) {
|
||||||
|
value = keyValue[1]
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return value
|
||||||
|
}
|
||||||
|
|
||||||
const redirect = () => {
|
const redirect = () => {
|
||||||
const uri = 'http://127.0.0.1:' + location.port
|
const uri = 'http://127.0.0.1:' + location.port
|
||||||
if (navigator.userAgent.match(/Android/i))
|
if (navigator.userAgent.match(/Android/i))
|
||||||
|
|
@ -41,7 +58,8 @@
|
||||||
window.location.replace(uri)
|
window.location.replace(uri)
|
||||||
}
|
}
|
||||||
(async () => {
|
(async () => {
|
||||||
document.getElementById('details').textContent = 'Booting kernel...'
|
const v = getSearch('v')
|
||||||
|
document.getElementById('details').textContent = "v" + v + ' Booting kernel...'
|
||||||
let progressing = false
|
let progressing = false
|
||||||
while (!progressing) {
|
while (!progressing) {
|
||||||
try {
|
try {
|
||||||
|
|
|
||||||
|
|
@ -402,7 +402,7 @@ const initKernel = (workspace, port, lang) => {
|
||||||
if (isDevEnv) {
|
if (isDevEnv) {
|
||||||
bootIndex = path.join(appDir, "electron", "boot.html");
|
bootIndex = path.join(appDir, "electron", "boot.html");
|
||||||
}
|
}
|
||||||
bootWindow.loadFile(bootIndex);
|
bootWindow.loadFile(bootIndex, {query: {v: appVer}});
|
||||||
bootWindow.show();
|
bootWindow.show();
|
||||||
|
|
||||||
const kernelName = "win32" === process.platform ? "SiYuan-Kernel.exe" : "SiYuan-Kernel";
|
const kernelName = "win32" === process.platform ? "SiYuan-Kernel.exe" : "SiYuan-Kernel";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue