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

onchange patch #33

Merged
merged 5 commits into from
Sep 26, 2022
Merged

onchange patch #33

merged 5 commits into from
Sep 26, 2022

Conversation

mouse0270
Copy link
Contributor

Removed attaching an onchange event to core setting. Instead places it in then promise.

This patch is designed to fix the conflict between MM+ and FtC, However, reloading after the setting is saved will remove any conflict with any other Module attaching an onchange event to that setting.

Removed attaching an onchange event to core setting. Instead places it in `then` promise.
Copy link
Collaborator

@arcanistzed arcanistzed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The existing implementation is meant to be an easily removable temporary fix until Foundry VTT fixes this issue. I guess that is sort of unlikely to happen, so I agree that doing this instead might make sense.

@@ -354,7 +354,9 @@ async function deactivationStep(chosenModules = []) {
await game.settings.set(moduleName, "modules", currSettings);
}

game.settings.set("core", ModuleManagement.CONFIG_SETTING, original);
game.settings.set("core", ModuleManagement.CONFIG_SETTING, original).then(r => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is inside an asynchronous function, so it makes more sense to await this line and then put the reload on the next line without using then. This is more in line with modern JavaScript best practices.

module.json Show resolved Hide resolved
v1.4.5

Verified

This commit was signed with the committer’s verified signature.
cpcloud Phillip Cloud
switched to await.
Fixed function logic.
Added Comment to end of Line in hopes to make it easy to find to remove.
@mouse0270
Copy link
Contributor Author

switched to await.
Fixed function logic.
Added Comment to end of Line in hopes to make it easy to find to remove.

CHANGELOG.md Outdated
@@ -1,3 +1,6 @@
# v1.4.5
- Moved window reload logic to `then` instead of core settings `onchange` event. Fixes incompatibility between MM+ and Ftc
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs to be updated

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@mouse0270
Copy link
Contributor Author

Sssshhhhhhhh.... It was always correct. lol

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

Successfully merging this pull request may close these issues.

2 participants