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:
Johannes Millan 2026-01-16 21:11:24 +01:00
parent 0e0c04915c
commit ba0e9ce002

View file

@ -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) {