mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-30 12:39:20 +03:00
Globalize rl.loadScript()
This commit is contained in:
parent
0106751e64
commit
cd734c7d5d
3 changed files with 14 additions and 15 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import { doc, createElement, SettingsCapa, SettingsGet } from 'Common/Globals';
|
||||
import { SettingsCapa, SettingsGet } from 'Common/Globals';
|
||||
import { staticLink } from 'Common/Links';
|
||||
|
||||
//import { showScreenPopup } from 'Knoin/Knoin';
|
||||
|
|
@ -22,13 +22,12 @@ export const
|
|||
|
||||
init() {
|
||||
if (SettingsCapa('OpenPGP') && window.crypto && crypto.getRandomValues) {
|
||||
const script = createElement('script', {src:staticLink('js/min/openpgp.min.js')});
|
||||
script.onload = () => this.loadKeyrings();
|
||||
script.onerror = () => {
|
||||
this.loadKeyrings();
|
||||
console.error(script.src);
|
||||
};
|
||||
doc.head.append(script);
|
||||
rl.loadScript(staticLink('js/min/openpgp.min.js'))
|
||||
.then(() => this.loadKeyrings())
|
||||
.catch(e => {
|
||||
this.loadKeyrings();
|
||||
console.error(e);
|
||||
});
|
||||
} else {
|
||||
this.loadKeyrings();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue