|
@ -149,14 +149,16 @@ vAPI.messaging = { |
|
|
/******************************************************************************/ |
|
|
/******************************************************************************/ |
|
|
|
|
|
|
|
|
var toggleListener = function({type, persisted}) { |
|
|
var toggleListener = function({type, persisted}) { |
|
|
if ( !persisted || !vAPI.messaging.connector ) { |
|
|
|
|
|
|
|
|
if ( !vAPI.messaging.connector ) { |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if ( type === 'pagehide' ) { |
|
|
if ( type === 'pagehide' ) { |
|
|
removeMessageListener(); |
|
|
removeMessageListener(); |
|
|
|
|
|
return; |
|
|
} |
|
|
} |
|
|
else { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ( persisted ) { |
|
|
addMessageListener(vAPI.messaging.connector); |
|
|
addMessageListener(vAPI.messaging.connector); |
|
|
} |
|
|
} |
|
|
}; |
|
|
}; |
|
|