mirror of
https://github.com/the-djmaze/snappymail.git
synced 2024-09-20 07:35:55 +08:00
Merge branch 'master' of github.com:the-djmaze/snappymail
This commit is contained in:
commit
36c8b97cb1
|
@ -301,9 +301,13 @@ populateMessageBody = (oMessage, popup) => {
|
|||
} else {
|
||||
let json = oData?.Result;
|
||||
if (json
|
||||
&& oMessage.hash === json.hash
|
||||
// && oMessage.folder === json.folder
|
||||
// && oMessage.uid == json.uid
|
||||
&& ((
|
||||
oMessage.hash && oMessage.hash === json.hash
|
||||
) || (
|
||||
!oMessage.hash
|
||||
&& oMessage.folder === json.folder
|
||||
&& oMessage.uid == json.uid)
|
||||
)
|
||||
&& oMessage.revivePropertiesFromJson(json)
|
||||
) {
|
||||
/*
|
||||
|
|
|
@ -13,6 +13,7 @@ document.onreadystatechange = () => {
|
|||
passThemesToIFrame();
|
||||
let form = document.querySelector('form.snappymail');
|
||||
form && SnappyMailFormHelper(form);
|
||||
setupUnifiedSearchListener()
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -136,15 +137,22 @@ function SnappyMailFormHelper(oForm)
|
|||
|
||||
return false;
|
||||
});
|
||||
}
|
||||
catch(e) {
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
}
|
||||
|
||||
function setupUnifiedSearchListener() {
|
||||
const iframe = document.getElementById('rliframe');
|
||||
if (!iframe || !iframe.contentWindow) return;
|
||||
|
||||
addEventListener('hashchange', (event) => {
|
||||
const search = event.newURL.substring(event.newURL.lastIndexOf('/') + 1);
|
||||
if (search && search.length < 25) {
|
||||
document.getElementById('rliframe').contentWindow.rl.app.messageList.mainSearch(search);
|
||||
const hashIndex = event.newURL.indexOf('#/mailbox/');
|
||||
if (hashIndex !== -1) {
|
||||
const hash = event.newURL.substring(hashIndex + 1);
|
||||
if (/\/[\w-]+\/[\w-]+\/\w\d+\/.{0,24}/.test(hash)) {
|
||||
iframe.contentWindow.location.hash = hash;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue