Skip to content

Commit

Permalink
Fix Wifi prompt bug in iOS companion
Browse files Browse the repository at this point in the history
Change-Id: I81f0e9dac8e677074f08cdebc035a235c8b5048d
  • Loading branch information
ewpatton committed Jan 9, 2025
1 parent 4e69f42 commit de7e1c4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
5 changes: 4 additions & 1 deletion appinventor/aicompanionapp/src/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,10 @@ public class ViewController: UINavigationController, UITextFieldDelegate {

// Implemented in Swift based on aiplayapp/src/edu/mit/appinventor/aicompanion3/Screen1.yail
private func checkWifi() {
self.didWifiCheck = true
guard !didWifiCheck else {
return
}
didWifiCheck = true
if PhoneStatus.GetWifiIpAddress().hasPrefix("Error") {
notifier1.ShowChooseDialog("Your Device does not appear to have a Wifi Connection",
"No WiFi", "Continue without WiFi", "Exit", false)
Expand Down
3 changes: 0 additions & 3 deletions appinventor/components-ios/src/Notifier.swift
Original file line number Diff line number Diff line change
Expand Up @@ -501,9 +501,6 @@ open class Notifier: NonvisibleComponent {

@objc fileprivate func afterChoosing(sender: UIButton) {
_activeAlert?.dismiss(animated: true)
if let activeAlert = _activeAlert, let index = _activeAlerts.firstIndex(of: activeAlert) {
_activeAlerts.remove(at: index) // Remove the dismissed alert from the array
}
if let button = sender as? CustomButton, let choice = button.value as? String {
if choice == "Cancel" {
ChoosingCanceled()
Expand Down

0 comments on commit de7e1c4

Please sign in to comment.