Using foundry's isNewer function rather than custom one

This commit is contained in:
WBHarry 2025-08-23 15:48:31 +02:00
parent 482adabae4
commit 9b332c3681
3 changed files with 4 additions and 17 deletions

View file

@ -1,10 +1,8 @@
import { versionCompare } from '../helpers/utils.mjs';
export async function runMigrations() {
let lastMigrationVersion = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.LastMigrationVersion);
if (!lastMigrationVersion) lastMigrationVersion = '1.0.6';
if (versionCompare(lastMigrationVersion, '1.1.0')) {
if (foundry.utils.isNewerVersion('1.1.0', lastMigrationVersion)) {
const compendiumActors = [];
for (let pack of game.packs) {
const documents = await pack.getDocuments();
@ -37,7 +35,7 @@ export async function runMigrations() {
lastMigrationVersion = '1.1.0';
}
if (versionCompare(lastMigrationVersion, '1.1.1')) {
if (foundry.utils.isNewerVersion('1.1.1', lastMigrationVersion)) {
const compendiumClasses = [];
for (let pack of game.packs) {
const documents = await pack.getDocuments();