You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-06-27 23:28:38 +02:00
Desktop: Do not allow installing plugins incompatible with current app version
This commit is contained in:
@ -334,8 +334,12 @@ export default class PluginService extends BaseService {
|
||||
}
|
||||
}
|
||||
|
||||
public isCompatible(pluginVersion: string): boolean {
|
||||
return compareVersions(this.appVersion_, pluginVersion) >= 0;
|
||||
}
|
||||
|
||||
public async runPlugin(plugin: Plugin) {
|
||||
if (compareVersions(this.appVersion_, plugin.manifest.app_min_version) < 0) {
|
||||
if (!this.isCompatible(plugin.manifest.app_min_version)) {
|
||||
throw new Error(`Plugin "${plugin.id}" was disabled because it requires Joplin version ${plugin.manifest.app_min_version} and current version is ${this.appVersion_}.`);
|
||||
} else {
|
||||
this.store_.dispatch({
|
||||
|
Reference in New Issue
Block a user