mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
Only initialize extension apis if necessary
This commit is contained in:
parent
c9368ed98f
commit
0f4d4eb5a9
3 changed files with 4 additions and 5 deletions
|
@ -168,7 +168,6 @@ $editorToolbar.then(({{ toolbar }}) => toolbar.appendGroup({{
|
|||
else ""
|
||||
)
|
||||
|
||||
print(righttopbtns_js)
|
||||
self.web.eval(f"{lefttopbtns_js} {righttopbtns_js}")
|
||||
|
||||
# Top buttons
|
||||
|
|
|
@ -45,10 +45,10 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|||
|
||||
setContext(buttonGroupKey, registerComponent);
|
||||
|
||||
export let api = {};
|
||||
export let api: Record<string, unknown> | undefined = undefined;
|
||||
let buttonGroupRef: HTMLDivElement;
|
||||
|
||||
$: if (buttonGroupRef) {
|
||||
$: if (api && buttonGroupRef) {
|
||||
const { addComponent, updateRegistration } = getDynamicInterface(
|
||||
buttonGroupRef
|
||||
);
|
||||
|
|
|
@ -30,10 +30,10 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|||
|
||||
setContext(buttonToolbarKey, registerComponent);
|
||||
|
||||
export let api = {};
|
||||
export let api: Record<string, unknown> | undefined = undefined;
|
||||
let buttonToolbarRef: HTMLDivElement;
|
||||
|
||||
$: if (buttonToolbarRef) {
|
||||
$: if (buttonToolbarRef && api) {
|
||||
const { addComponent, updateRegistration } = getDynamicInterface(
|
||||
buttonToolbarRef
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue