Just wanna to check if customer logged in by javascript use
Magento_Customer/js/model/customer.
I've included following js file in module:
define([
"jquery",
'Magento_Customer/js/model/customer',
], function($, customer) {
'use strict';
$.widget('conv.bolPrices', {
_init: function init() {
console.log('customer', customer);
console.log('Logged in', customer.isLoggedIn()); //getting undefined
},
});
return $.conv.bolPrices;
});
After login, every time when I am loading page I am getting undefined value, instead true/false.
I wanna to do it use model/customer. I cleared cache, removed generated/*, etc, read a lot of topics about this theme, but had no success.
I very appreciate any help and advice. Thanks.