Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Locked settings are not checked to still exist when saving after closing #89

Closed
PepijnMC opened this issue Jan 12, 2023 · 1 comment
Closed

Comments

@PepijnMC
Copy link

The following code, particularly line 1187 returns an error when a previously locked setting no longer exists in the module as settingDetails is undefined.

static async closeSettingsConfig(app, elem) {
if (game.user.isGM) {
for (const [key, value] of Object.entries(MMP.#LockedSettings)) {
const settingDetails = game.settings.settings.get(key);
MMP.#LockedSettings[`${key}`] = game.settings.get(settingDetails.namespace, settingDetails.key);
}
MODULE.setting('lockedSettings', MMP.#LockedSettings).then(response => {
MODULE.log('UPDATED LOCKED SETTINGS', MMP.#LockedSettings);
});
}
}

Changing it to something like this seems to resolve the issue:

if (settingDetails) MMP.#LockedSettings[`${key}`] = game.settings.get(settingDetails.namespace, settingDetails.key);
else delete MMP.#LockedSettings[`${key}`];
mouse0270 added a commit that referenced this issue Mar 4, 2023
- Added Notification for when an Update for Core or System are waiting for you
- Fixed Missing Active Modules Count. By Default this is hidden, however there is a setting to display it either on the button or in its default location
- Fixed Locked Settings not being checked if the setting no longer exists after closing.
  - Fix provided by [@PepijnMC](#89 (comment))
- Added Individual Expand Button for Module Details
@mouse0270
Copy link
Owner

This has been added in version 2.1.6. thanks!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants