Hide the window until loading is done
This commit is contained in:
6 files changed
+14
-19
No files matched your search
@@ -18,6 +18,7 @@
|
||||
"core:window:allow-start-dragging",
|
||||
"core:window:allow-toggle-maximize",
|
||||
"core:window:allow-request-user-attention",
|
||||
"core:window:allow-show",
|
||||
"core:webview:allow-create-webview-window",
|
||||
"fs:default",
|
||||
"fs:allow-remove",
|
||||
|
||||
@@ -836,6 +836,8 @@ async fn update(
|
||||
let mut new_url = window.url().unwrap();
|
||||
new_url.set_path("/update/updating");
|
||||
window.navigate(new_url).unwrap();
|
||||
let _ = window.show();
|
||||
let _ = window.set_focus();
|
||||
|
||||
let mut downloaded = 0;
|
||||
|
||||
|
||||
@@ -17,7 +17,8 @@
|
||||
"width": 1000,
|
||||
"height": 600,
|
||||
"minWidth": 1000,
|
||||
"minHeight": 500
|
||||
"minHeight": 500,
|
||||
"visible": false
|
||||
}
|
||||
],
|
||||
"security": {
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
"height": 600,
|
||||
"minWidth": 1000,
|
||||
"minHeight": 500,
|
||||
"visible": false,
|
||||
"titleBarStyle": "Overlay",
|
||||
"hiddenTitle": true
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
"height": 632,
|
||||
"minWidth": 1000,
|
||||
"minHeight": 532,
|
||||
"visible": false,
|
||||
"decorations": false,
|
||||
"shadow": true
|
||||
}
|
||||
|
||||
+7
-18
@@ -743,11 +743,15 @@ export default function RootLayout ({
|
||||
return
|
||||
}
|
||||
|
||||
setLoading(false)
|
||||
|
||||
if (!(await isPermissionGranted())) {
|
||||
await requestPermission()
|
||||
}
|
||||
|
||||
setLoading(false)
|
||||
|
||||
const window = getCurrentWindow()
|
||||
await window.show()
|
||||
await window.setFocus()
|
||||
})()
|
||||
}, [])
|
||||
|
||||
@@ -841,22 +845,7 @@ export default function RootLayout ({
|
||||
<>
|
||||
<html lang='en' className={roboto.className}>
|
||||
<body className={theme + '-theme'}>
|
||||
{loading ? (
|
||||
<>
|
||||
{platformName == 'windows' && (
|
||||
<div className='relative z-2 w-screen border-b border-b-(--col3) h-8.25 bg-(--col1)' />
|
||||
)}
|
||||
<div
|
||||
className={`w-screen ${
|
||||
platformName == 'windows'
|
||||
? 'h-[calc(100vh-64px)]'
|
||||
: 'h-screen'
|
||||
} flex items-center justify-center`}
|
||||
>
|
||||
<p className='text-7xl text-center'>Loading...</p>
|
||||
</div>
|
||||
</>
|
||||
) : (
|
||||
{!loading && (
|
||||
<GlobalProvider
|
||||
value={{
|
||||
serverVersionList,
|
||||
|
||||
Reference in new issue
Block a user