mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-09-03 04:31:46 +02:00
delay injecting scripts on app load
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import {EditorWebView, getWebviewInit} from '../Functions';
|
||||
|
||||
const reset = `
|
||||
isLoading = true;
|
||||
document.getElementById("titleInput").value = '';
|
||||
@@ -122,7 +124,14 @@ tinymce.activeEditor.focus();
|
||||
`;
|
||||
|
||||
function call(webview, func) {
|
||||
webview.current?.injectJavaScript(func);
|
||||
if (getWebviewInit()) {
|
||||
webview.current?.injectJavaScript(func);
|
||||
} else {
|
||||
setTimeout(() => {
|
||||
console.log('run after delay');
|
||||
webview.current?.injectJavaScript(func);
|
||||
}, 1000);
|
||||
}
|
||||
}
|
||||
|
||||
const undo = `
|
||||
|
||||
@@ -291,7 +291,8 @@ const ToolbarItem = ({
|
||||
<Paragraph
|
||||
size={SIZE.md}
|
||||
color={selected ? colors.accent : colors.pri}>
|
||||
{formatValue || currentText}
|
||||
{formatValue || currentText || "12pt"}
|
||||
|
||||
</Paragraph>
|
||||
) : text && groupFormat !== 'header' ? (
|
||||
<Paragraph
|
||||
@@ -307,6 +308,7 @@ const ToolbarItem = ({
|
||||
}}
|
||||
size={SIZE.md}>
|
||||
{currentText || text}
|
||||
|
||||
</Paragraph>
|
||||
) : (
|
||||
<Icon
|
||||
|
||||
Reference in New Issue
Block a user