Skip to content

Commit e884d4c

Browse files
committed
INTERNAL: Creating an Internet card without having Chrome installed will ask you to install Chrome.
INTERNAL: Sounds now only play while NOT loading a project. INTERNAL: Editing an Internet card's URL and canceling without changing it shouldn't reload the page.
1 parent 18ad6a9 commit e884d4c

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

browser.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,14 @@ func NewBrowserTab(w, h int, contents *InternetContents) (*BrowserTab, error) {
105105

106106
// Try context to confirm it exists and is good
107107
if err := chromedp.Run(browserContext, chromedp.Reload()); err != nil {
108-
globals.EventLog.Log("Error creating web card: %s", true, err.Error())
109-
cancel() // Cancel the broken browser context
108+
errText := err.Error()
109+
110+
if errText == `exec: "google-chrome": executable file not found in $PATH` {
111+
errText = "Google Chrome executable not found;\nare you sure you have a recent version of Chrome (or a Chrome-based browser) installed?"
112+
}
113+
globals.EventLog.Log("Error creating web card: %s", true, errText)
114+
115+
cancel() // Cancel the broken browser context (unsure if this is strictly necessary)
110116
return nil, err
111117
}
112118

main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3927,7 +3927,7 @@ horizontally.`))
39273927
}
39283928

39293929
urlLabel.OnClickOut = func() {
3930-
if wc := card.Contents.(*InternetContents); wc.BrowserTab != nil {
3930+
if wc := card.Contents.(*InternetContents); wc.BrowserTab != nil && wc.BrowserTab.CurrentURL != urlLabel.TextAsString() {
39313931
wc.BrowserTab.Navigate(urlLabel.TextAsString())
39323932
}
39333933
}

sound.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,11 @@ const (
246246

247247
func PlayUISound(soundType UISoundType) {
248248

249+
// Don't play sounds when loading projects
250+
if globals.NextProject != nil && globals.NextProject.Loading {
251+
return
252+
}
253+
249254
snd, _ := globals.Resources.Get(uiSounds[soundType][rand.IntN(len(uiSounds[soundType]))]).AsNewSound(true, AudioChannelUI)
250255
if snd != nil {
251256
snd.Play()

0 commit comments

Comments
 (0)