mirror of
https://github.com/johannesjo/super-productivity.git
synced 2026-01-23 02:36:05 +00:00
fix(plugins): resolve PluginHooks runtime error in procrastination-buster
Replace PluginHooks.LANGUAGE_CHANGE enum reference with string literal
'languageChange' to fix runtime error. The type-only import of PluginHooks
was not available at runtime, causing "PluginHooks is not defined" error
when installing the plugin.
The hook registration now uses the string value directly:
- Before: plugin.registerHook(PluginHooks.LANGUAGE_CHANGE, ...)
- After: plugin.registerHook('languageChange', ...)
This commit is contained in:
parent
0e0c04915c
commit
ba0e9ce002
1 changed files with 1 additions and 2 deletions
|
|
@ -1,6 +1,5 @@
|
|||
// Procrastination Buster Plugin for Super Productivity
|
||||
import { PluginAPI } from '@super-productivity/plugin-api';
|
||||
import type { PluginHooks } from '@super-productivity/plugin-api';
|
||||
|
||||
declare const plugin: PluginAPI;
|
||||
|
||||
|
|
@ -31,7 +30,7 @@ if (plugin.onMessage) {
|
|||
}
|
||||
|
||||
// Listen for language changes and notify iframe
|
||||
plugin.registerHook(PluginHooks.LANGUAGE_CHANGE, (language: string) => {
|
||||
plugin.registerHook('languageChange', (language: string) => {
|
||||
// Notify the iframe about language change
|
||||
const iframe = document.querySelector('iframe[data-plugin-iframe]');
|
||||
if (iframe && (iframe as HTMLIFrameElement).contentWindow) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue