| Server IP : 54.36.91.62 / Your IP : 216.73.217.94 Web Server : Apache System : Linux webm013.cluster127.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64 User : coopiak ( 151928) PHP Version : 8.3.23 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/coopiak/dansnotreville-fr/plugins/system/jomsocialchatbar/assets/js/store/chats/ |
Upload File : |
var localStorage = require( 'joms' ).storage;
module.exports = {
opened: function( state, getters ) {
var opened = [],
needClose = [],
limit = state.limitOpened,
active = state.active,
idx;
if ( limit ) {
var chats = _.filter( state.opened, function( id ) {
return state.info[id];
});
if ( chats.length > limit && limit ) {
_.each( chats.splice( limit ), function( id ) {
if ( id != active) {
needClose.push( id );
}
});
idx = chats.indexOf( active );
if ( active && idx === -1 ) {
needClose.push( chats.pop() );
chats.push( active );
}
}
_.each( chats, function( id ) {
if ( state.info[id] ) {
opened.push( state.info[id] );
}
});
} else {
needClose = state.opened;
}
return {
opened: opened,
needClose: needClose
}
},
sidebar: function( state, getters) {
var sidebar = [];
_.each( state.sidebar, function ( id ) {
if (state.info[id]) {
sidebar.push(state.info[id]);
}
});
return sidebar;
}
};