File tree Expand file tree Collapse file tree 2 files changed +24
-3
lines changed Expand file tree Collapse file tree 2 files changed +24
-3
lines changed Original file line number Diff line number Diff line change 8
8
import * as Installer from " ../../../wailsjs/go/installer/Installer.js" ;
9
9
import Heading from " ../text/Heading.svelte" ;
10
10
import Button from " ../Button.svelte" ;
11
- import { closeWindow } from " ../windows/index.js" ;
11
+ import { closeWindow , resizeWindow } from " ../windows/index.js" ;
12
12
import { BrowserOpenURL } from " ../../../wailsjs/runtime/runtime.js" ;
13
13
14
14
import * as IPC from " ./ipc" ;
26
26
27
27
setTimeout (() => IPC .doAction (op , path , onAction ));
28
28
}
29
+
30
+ let isOwned = true ;
31
+
32
+ // svelte hacks...
33
+ async function CheckOwnership() {
34
+ isOwned = await Installer .CheckForOwnershipDarwin (path );
35
+ }
36
+
37
+ $ : if (! isOwned ) {
38
+ resizeWindow (_windowId , 450 , 510 );
39
+ } else {
40
+ resizeWindow (_windowId , 450 , 200 );
41
+ }
29
42
</script >
30
43
31
44
<section role =" dialog" >
32
45
<Heading tag =" h6" --color =" var(--accent-red)" >Oh no!</Heading >
33
46
<p >Something went wrong!</p >
34
47
{#if message }
35
48
{#if message .includes (" file exists" ) || message .includes (" permission denied" )}
36
- {#await Installer . CheckForOwnershipDarwin ( path )}
49
+ {#await CheckOwnership ( )}
37
50
<p >{message }</p >
38
- {:then isOwned }
51
+ {:then }
39
52
{#if ! isOwned }
40
53
<p >Hmm... seems like you've encountered a Mac-specific problem! Usually, this is one of two things:</p >
41
54
<p >
Original file line number Diff line number Diff line change @@ -48,6 +48,14 @@ export const closeWindow = (id: string) => {
48
48
} ) ;
49
49
} ;
50
50
51
+ export const resizeWindow = ( id : string , w : number , h : number ) => {
52
+ windowStore . update ( windows => {
53
+ windows [ id ] . props . width = w ;
54
+ windows [ id ] . props . height = h ;
55
+ return windows ;
56
+ } ) ;
57
+ }
58
+
51
59
let zIndex = 0 ;
52
60
export const getFocusZIndex = ( ) => {
53
61
zIndex ++ ;
You can’t perform that action at this time.
0 commit comments