2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-14 11:05:41 +00:00
Files
InvenTree/src/frontend/lib/functions/Plugins.tsx
2025-06-06 18:35:54 +10:00

19 lines
570 B
TypeScript

import {
INVENTREE_PLUGIN_VERSION,
type InvenTreePluginContext
} from '../types/Plugins';
/**
* Check that the plugin version matches the expected version.
* This is a helper function which only generates a warning if there is a mismatch.
*/
export function checkPluginVersion(context: InvenTreePluginContext) {
const systemVersion: string = context?.version?.inventree || '';
if (INVENTREE_PLUGIN_VERSION != systemVersion) {
console.info(
`Plugin version mismatch! Expected version ${INVENTREE_PLUGIN_VERSION}, got ${systemVersion}`
);
}
}