Skip to content

Commit

Permalink
fetch chatcounts on push; Don't long wait
Browse files Browse the repository at this point in the history
  • Loading branch information
chriscant committed Aug 29, 2018
1 parent db36e61 commit 7e1d656
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
6 changes: 3 additions & 3 deletions dev/webpack.appfd.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ module.exports = new Config().extend({
}),
// CC new FaviconsPlugin('images/user_logo.png'),
new webpack.DefinePlugin({
APP_VERSION: JSON.stringify('1.4.0, 28 August 2018'),
APP_VERSION: JSON.stringify('1.4.0, 29 August 2018'),
// CC SET ABOVE: API: JSON.stringify(BASE_URL+'/api/'),
FACEBOOK_APPID: JSON.stringify('134980666550322'),
FACEBOOK_GRAFFITI_APPID: JSON.stringify('115376591981611'),
Expand Down Expand Up @@ -100,13 +100,13 @@ module.exports = new Config().extend({
new CopyWebpackPlugin([
{from: 'http/xdk', to: 'xdk'}
]),
/*new webpack.optimize.UglifyJsPlugin({
new webpack.optimize.UglifyJsPlugin({
sourceMap: true,
minimize: true,
compress: {
warnings: false
}
}),*/
}),

// split vendor js into its own file
new webpack.optimize.CommonsChunkPlugin({
Expand Down
2 changes: 2 additions & 0 deletions http/js/iznik/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,7 @@ define([
if ($(this).html() != chatcount) {
if (chatcount > 0) {
$(this).html(chatcount).show();
console.log("chatcount set to: " + chatcount);
} else {
$(this).empty().hide();
}
Expand All @@ -457,6 +458,7 @@ define([
if ($(this).html() != notifcount) {
if (notifcount > 0) {
$(this).html(notifcount);
console.log("notifcount set to: " + notifcount);
$(this).css('visibility', 'visible');
} else {
$(this).empty();
Expand Down
2 changes: 1 addition & 1 deletion http/js/iznik/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -390,8 +390,8 @@ function mainOnAppStart() { // CC
var notifcount = parseInt(data.additionalData.notifcount);
console.log("Got chatcount " + chatcount + " notifcount " + notifcount);
if (!isNaN(chatcount) && !isNaN(notifcount)) {
console.log("Setting counts");
Iznik.setHeaderCounts(chatcount, notifcount);
Iznik.Session.chats.fetch();
}
}

Expand Down
2 changes: 1 addition & 1 deletion http/js/iznik/models/chat/chat.js
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ define([

if (Iznik.Session) {
// Start our poll for new info.
self.wait();
// DON'T POLL ON MOBILE APP: self.wait();

// Start our fallback fetch for new info in case the poll doesn't tell us.
_.delay(_.bind(self.fallback, self), self.fallbackInterval);
Expand Down

0 comments on commit 7e1d656

Please sign in to comment.