If you use this structure
if (condition) {
callback(true);
} else {
callback(false);
}
it is the proper way to do it.
At first glance, I do not see any issues with your code, and I’m glad to hear that you’ve made it work as expected.