* Add migration function for 20220821

This commit is contained in:
Kreuvf
2022-08-23 19:37:41 +02:00
parent 8d134e9355
commit ffe30ca58b
@@ -18061,6 +18061,7 @@ Relevant character sheet versions
* 20211010: Clearer attribute names for life energy, astral energy etc.
* 20220116: New roll buttons
* 20220604: Visibili Vanitar spelling fixes
* 20220821: Sheet Initialization
*/
function migrationCheck() {
safeGetAttrs(["character_sheet_version", "data_version", "sheet_initialized"], function(v) {
@@ -18159,7 +18160,8 @@ var versionsWithMigrations = [
20210718,
20211010,
20220116,
20220604
20220604,
20220821
];
function initializeSheet(migrationChain) {
@@ -18908,6 +18910,20 @@ function migrateTo20220604(migrationChain) {
});
}
/*
Migration steps:
- Initialize attribute "sheet_initialized"
*/
function migrateTo20220821(migrationChain) {
var caller = "migrateTo20220821";
debugLog(caller, "Invoked.");
var attrsToChange = { "sheet_initialized": true };
safeSetAttrs(attrsToChange, {}, function(){
callNextMigration(migrationChain);
});
}
on("sheet:opened", function() {
migrationCheck();
safeSetAttrs({ "safe-sheet-open": Date.now() });