Skip to content

Commit

Permalink
Change how Analytics is imported
Browse files Browse the repository at this point in the history
  • Loading branch information
manueliglesias committed May 15, 2018
1 parent fa8c83f commit c33b051
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
import { ConsoleLogger as Logger } from '../../Common';
import Analytics from '../../Analytics';
import { ConsoleLogger as Logger, Amplify } from '../../Common';

/**
* Provides a means to registering a service worker in the browser
Expand Down Expand Up @@ -41,7 +40,7 @@ class ServiceWorkerClass {
private _subscription: PushSubscription;

// The AWS Amplify logger
private _logger: Logger = new Logger('ServiceWorker', 'DEBUG');
private _logger: Logger = new Logger('ServiceWorker');

constructor() { }

Expand Down Expand Up @@ -173,7 +172,7 @@ class ServiceWorkerClass {
this._serviceWorker.addEventListener('statechange', event => {
const currentState = this._serviceWorker.state;
this._logger.debug(`ServiceWorker statechange: ${currentState}`);
Analytics.record('ServiceWorker', {
Amplify.Analytics.record('ServiceWorker', {
'state': currentState
});
});
Expand Down

0 comments on commit c33b051

Please sign in to comment.