aboutsummaryrefslogtreecommitdiffstats
path: root/src/features/todos/preload.js
diff options
context:
space:
mode:
authorLibravatar Markus Hatvan <markus_hatvan@aon.at>2021-09-14 19:58:52 +0200
committerLibravatar GitHub <noreply@github.com>2021-09-14 19:58:52 +0200
commit95df3522a15631abc51a4295cae0ea401a8d4e1e (patch)
treee5eb0f368c947683f01458e912f21756fb0d99cb /src/features/todos/preload.js
parentdocs: add sad270 as a contributor for bug, userTesting [skip ci] (#1941) (diff)
downloadferdium-app-95df3522a15631abc51a4295cae0ea401a8d4e1e.tar.gz
ferdium-app-95df3522a15631abc51a4295cae0ea401a8d4e1e.tar.zst
ferdium-app-95df3522a15631abc51a4295cae0ea401a8d4e1e.zip
feat: add eslint-plugin-unicorn (#1936)
Diffstat (limited to 'src/features/todos/preload.js')
-rw-r--r--src/features/todos/preload.js12
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
8let hostMessageListener = ({ action }) => { 8let 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 }) => {
15window.ferdi = { 17window.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) => {
30if (window.location.href === 'https://app.franztodos.com/login/') { 34if (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.
34This service will only work with accounts registered with Franz - no Ferdi accounts will work here! 38This service will only work with accounts registered with Franz - no Ferdi accounts will work here!
35If you do not have a Franz account you can change the Todo service by going into Ferdi's settings and changing the "Todo server". 39If you do not have a Franz account you can change the Todo service by going into Ferdi's settings and changing the "Todo server".
36You can choose any service as this Todo server, e.g. Todoist or Apple Notes.`; 40You 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