"use strict";
var pwa = pwa || {};
/*
Manage message

____________________

*/
//--##
pwa.message = {};

pwa.message.update = ( urlmsg ) => {
	logger.info( 'get message update' );
	axios.get( urlmsg, { headers: pwa.state.data.headers } )
		.then( rep => {
			const tpl = document.getElementById( "app_menutopmessage" );
			document.getElementById( "topmenumessages" )
				.innerHTML = Mustache.render( tpl.innerHTML, { messagess: rep.data } );
		} )
		.catch( err => {
			logger.info( `Err pwa.notification.update data from ${urlmsg}`, err );
		} );

};
/*pwa
	.state
	.ready( pwa.notification.update( 'static/data/staticContentwebsite/notification.json' ) );
*/
