I've been struggling with this for 2 hours now, app.session
doesn't work. Uncaught TypeError: app.session is null
. I tried other ways, but I couldn't find any way to get it to work. My code is below.
app.initializers.add('kalucky/achievements', () => {
console.log('[kalucky/achievements] Loaded!');
const user = app.session.user;
console.log(user);
});
extend(UserPage.prototype, 'navItems', function(items) {
// console.log('extend', app.session.user.data.attributes.username);
items.add(
'achievements',
LinkButton.component({
href: '#',
children: ['Osiągnięcia', <span className="Button-badge">1</span>],
icon: 'fas fa-trophy',
}),
85
);
});