             when 'ranking' then handle_ranking(data)
             when 'bet-update'
                 $('#jackpot').text(data.jackpot)
-                if data.maxbet?
-                    bet.maxbet = data.maxbet
-                    stream.pending_ranking_update = true
+                if data.max_bet?
+                    if $('#bet').val() == bet.maxbet
+                        # The earlier bet was a maxbet, so it is nice
+                        # to update it to reflect the update.
+                        $('#bet').val(data.max_bet)
+                    bet.maxbet = data.max_bet
+                    if login_data.name?
+                        stream.pending_ranking_update = true
             when 'balance' then $('#balance').text(data.balance)
             when 'address'
                 login_data.address = data.address

        for item in ['#myprofit', '#nbet', '#nwin', '#npattern', '#wagered']
            $(item).text('Error')
        return
    console.log(data)
    show_ranking(data.ranking)
    $('#myprofit').text(numcomma(data.profit))
    $('#wagered').text(numcomma(data.wagered))

        $('#nonce').val(data.nonce)
        $('#useed').val(data.useed)
        $('#sshash').val(data.sshash)

        # Recent history
        table = $('#history tbody')
