lubkovsv / google-plus-hangout-samples

Automatically exported from code.google.com/p/google-plus-hangout-samples
0 stars 0 forks source link

Sample app logs "New count" as pre-incremented value #6

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Open console
2. Run sample app
3. Click "Click me!".  Note that log says "New count is 0", but the count is 
actually 1 and updated on the screen and in the state appropriately.

What is the expected output? What do you see instead?
Should say "New count is 1".  Says "New count is 0"

What version of the product are you using? On what operating system?

Please provide any additional information below.

in app.js in countButtonClick(), just increment value before the console.log 
command.  Then do not increment it in the submitDelta call.  Like this:

....
  value += 1;
  console.log("New count is " + value);
  // Send update to shared space.
  // NOTE:  Only ever send strings as values in the key-value pairs
  gapi.hangout.data.submitDelta({'count': '' + (value)});
....

Original issue reported on code.google.com by djasonh...@gmail.com on 27 Sep 2011 at 9:01