   
   func addOrange(id:String) {
     if webView != nil {
+      hasOrange = true
       webView!.evaluateJavaScript(showOrange) { (result, error) in
         self.sendMessage(id:id, message:"OK")
       }

            case "encoded":
              if data != nil {
                data = data!.base64Decoded()
              }
            default:
              self.log("Unknown command option: \(messageParts[i])")

      if parts.count > 1 {
        data = parts[1]
      }
      let messageParts = message.components(separatedBy: ".")
      if messageParts.count > 1 {
        message = messageParts[0]
        for i in 1..<messageParts.count {
