File tree Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -61,7 +61,6 @@ class AppView extends Tonic {
61
61
async reloadPreviewWindows ( ) {
62
62
clearTimeout ( this . debounce )
63
63
this . debounce = setTimeout ( ( ) => {
64
- console . log ( this . previewWindows )
65
64
for ( const w of Object . values ( this . previewWindows ) ) {
66
65
w . navigate ( this . state . indexURL + `?zoom=${ this . state . zoom [ w . index ] } ` )
67
66
}
@@ -128,13 +127,15 @@ class AppView extends Tonic {
128
127
opts . minHeight = Math . floor ( height / scale )
129
128
}
130
129
131
- const w = await application . createWindow ( opts )
130
+ try {
131
+ const w = await application . createWindow ( opts )
132
132
133
- w . channel . addEventListener ( 'message' , e => {
134
- this . state . zoom [ w . index ] = e . data . zoom || 1
135
- } )
133
+ w . channel . addEventListener ( 'message' , e => {
134
+ this . state . zoom [ w . index ] = e . data . zoom || 1
135
+ } )
136
136
137
- this . previewWindows [ w . index ] = w
137
+ this . previewWindows [ w . index ] = w
138
+ } catch { }
138
139
}
139
140
}
140
141
Original file line number Diff line number Diff line change @@ -67,6 +67,10 @@ class AppProperties extends Tonic {
67
67
const editor = document . querySelector ( 'app-editor' )
68
68
const project = document . querySelector ( 'app-project' )
69
69
70
+ if ( event === 'preview' ) {
71
+ app . activatePreviewWindows ( )
72
+ }
73
+
70
74
if ( event === 'insert-native-extension' ) {
71
75
await project . insert ( {
72
76
label : 'extension.cc' ,
You can’t perform that action at this time.
0 commit comments