From 25c3bc157d743bf3bf29db86f2849928bac276d8 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Sat, 14 Jun 2014 13:58:20 +0200 Subject: [PATCH] Removed race condition. --- app/assets/javascripts/app/lib/app_post/auth.js.coffee | 2 +- app/assets/javascripts/app/lib/app_post/collection.js.coffee | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/app/lib/app_post/auth.js.coffee b/app/assets/javascripts/app/lib/app_post/auth.js.coffee index 1ea34cd59..081517825 100644 --- a/app/assets/javascripts/app/lib/app_post/auth.js.coffee +++ b/app/assets/javascripts/app/lib/app_post/auth.js.coffee @@ -88,7 +88,7 @@ class App.Auth # refresh default collections if data.collections - App.Event.trigger 'resetCollection', data.collections + App.Collection.resetCollections( data.collections ) # trigger auth ok with new session data App.Event.trigger( 'auth', data.session ) diff --git a/app/assets/javascripts/app/lib/app_post/collection.js.coffee b/app/assets/javascripts/app/lib/app_post/collection.js.coffee index b715ebb5e..36ab85d26 100644 --- a/app/assets/javascripts/app/lib/app_post/collection.js.coffee +++ b/app/assets/javascripts/app/lib/app_post/collection.js.coffee @@ -19,10 +19,10 @@ class App.Collection _instance ?= new _collectionSingleton _instance.reset( args ) - @resetCollection: ( args ) -> + @resetCollections: ( args ) -> if _instance == undefined _instance ?= new _collectionSingleton - _instance.resetCollection( args ) + _instance.resetCollections( args ) class _collectionSingleton extends Spine.Module @include App.LogInclude