mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 14:40:12 +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) => {
|
||||
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 uri = 'http://127.0.0.1:' + location.port
|
||||
if (navigator.userAgent.match(/Android/i))
|
||||
|
|
@ -41,7 +58,8 @@
|
|||
window.location.replace(uri)
|
||||
}
|
||||
(async () => {
|
||||
document.getElementById('details').textContent = 'Booting kernel...'
|
||||
const v = getSearch('v')
|
||||
document.getElementById('details').textContent = "v" + v + ' Booting kernel...'
|
||||
let progressing = false
|
||||
while (!progressing) {
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -402,7 +402,7 @@ const initKernel = (workspace, port, lang) => {
|
|||
if (isDevEnv) {
|
||||
bootIndex = path.join(appDir, "electron", "boot.html");
|
||||
}
|
||||
bootWindow.loadFile(bootIndex);
|
||||
bootWindow.loadFile(bootIndex, {query: {v: appVer}});
|
||||
bootWindow.show();
|
||||
|
||||
const kernelName = "win32" === process.platform ? "SiYuan-Kernel.exe" : "SiYuan-Kernel";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue