diff options
Diffstat (limited to 'src/features/todos/preload.js')
-rw-r--r-- | src/features/todos/preload.js | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/features/todos/preload.js b/src/features/todos/preload.js index 9bd76a704..3b86ddbc5 100644 --- a/src/features/todos/preload.js +++ b/src/features/todos/preload.js | |||
@@ -7,7 +7,9 @@ debug('Preloading Todos Webview'); | |||
7 | 7 | ||
8 | let hostMessageListener = ({ action }) => { | 8 | let hostMessageListener = ({ action }) => { |
9 | switch (action) { | 9 | switch (action) { |
10 | case 'todos:initialize-as-service': ipcRenderer.sendToHost('hello'); break; | 10 | case 'todos:initialize-as-service': |
11 | ipcRenderer.sendToHost('hello'); | ||
12 | break; | ||
11 | default: | 13 | default: |
12 | } | 14 | } |
13 | }; | 15 | }; |
@@ -15,7 +17,9 @@ let hostMessageListener = ({ action }) => { | |||
15 | window.ferdi = { | 17 | window.ferdi = { |
16 | onInitialize(ipcHostMessageListener) { | 18 | onInitialize(ipcHostMessageListener) { |
17 | hostMessageListener = ipcHostMessageListener; | 19 | hostMessageListener = ipcHostMessageListener; |
18 | ipcRenderer.sendToHost(IPC.TODOS_CLIENT_CHANNEL, { action: 'todos:initialized' }); | 20 | ipcRenderer.sendToHost(IPC.TODOS_CLIENT_CHANNEL, { |
21 | action: 'todos:initialized', | ||
22 | }); | ||
19 | }, | 23 | }, |
20 | sendToHost(message) { | 24 | sendToHost(message) { |
21 | ipcRenderer.sendToHost(IPC.TODOS_CLIENT_CHANNEL, message); | 25 | ipcRenderer.sendToHost(IPC.TODOS_CLIENT_CHANNEL, message); |
@@ -30,7 +34,7 @@ ipcRenderer.on(IPC.TODOS_HOST_CHANNEL, (event, message) => { | |||
30 | if (window.location.href === 'https://app.franztodos.com/login/') { | 34 | if (window.location.href === 'https://app.franztodos.com/login/') { |
31 | // Insert info element informing about Franz accounts | 35 | // Insert info element informing about Franz accounts |
32 | const infoElement = document.createElement('p'); | 36 | const infoElement = document.createElement('p'); |
33 | infoElement.innerText = `You are using Franz's official Todo Service. | 37 | infoElement.textContent = `You are using Franz's official Todo Service. |
34 | This service will only work with accounts registered with Franz - no Ferdi accounts will work here! | 38 | This service will only work with accounts registered with Franz - no Ferdi accounts will work here! |
35 | If you do not have a Franz account you can change the Todo service by going into Ferdi's settings and changing the "Todo server". | 39 | If you do not have a Franz account you can change the Todo service by going into Ferdi's settings and changing the "Todo server". |
36 | You can choose any service as this Todo server, e.g. Todoist or Apple Notes.`; | 40 | You can choose any service as this Todo server, e.g. Todoist or Apple Notes.`; |
@@ -42,7 +46,7 @@ You can choose any service as this Todo server, e.g. Todoist or Apple Notes.`; | |||
42 | const textElement = document.querySelector('p'); | 46 | const textElement = document.querySelector('p'); |
43 | if (textElement) { | 47 | if (textElement) { |
44 | clearInterval(waitForReact); | 48 | clearInterval(waitForReact); |
45 | textElement.parentElement.insertBefore(infoElement, textElement); | 49 | textElement.parentElement?.insertBefore(infoElement, textElement); |
46 | } else { | 50 | } else { |
47 | numChecks += 1; | 51 | numChecks += 1; |
48 | 52 | ||