Skip to content

Commit

Permalink
- Workaround for [SMP bug](TheQwertiest/foo_spider_monkey_panel#205) …
Browse files Browse the repository at this point in the history
…which made properties not being saved when closing foobar. That made the initial popups on first installation to keep firing on every restart.
  • Loading branch information
regorxxx committed Feb 19, 2023
1 parent c608a15 commit 24c0219
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions main/search_by_distance/search_by_distance.js
Expand Up @@ -182,6 +182,14 @@ if (!sbd.panelProperties.firstPopup[1]) {
if (typeof buttonsBar === 'undefined' && typeof bNotProperties === 'undefined') {
doOnce('findStyleGenresMissingGraphCheck', debounce(findStyleGenresMissingGraphCheck, 500))(sbd.panelProperties);
}
// SMP Bug: https://github.com/TheQwertiest/foo_spider_monkey_panel/issues/205
// Force setting it to true at 30 secs after startup
setTimeout(() => {
if (!sbd.panelProperties.firstPopup[1]) {
sbd.panelProperties.firstPopup[1] = true;
overwriteProperties(sbd.panelProperties);
}
}, 60000);
}

/*
Expand Down Expand Up @@ -367,10 +375,12 @@ addEventListener('on_script_unload', () => {
if (sbd.panelProperties.bStartLogging[1]) {console.log('Search by Distance: Saving Cache.');}
if (cacheLink) {saveCache(cacheLink, folders.data + 'searchByDistance_cacheLink.json');}
if (cacheLinkSet) {saveCache(cacheLinkSet, folders.data + 'searchByDistance_cacheLinkSet.json');}
if (!sbd.panelProperties.firstPopup[1]) {
sbd.panelProperties.firstPopup[1] = true;
overwriteProperties(sbd.panelProperties); // Updates panel
}
// SMP Bug: https://github.com/TheQwertiest/foo_spider_monkey_panel/issues/205
// if (!sbd.panelProperties.firstPopup[1]) {
// sbd.panelProperties.firstPopup[1] = true;
// overwriteProperties(sbd.panelProperties); // Updates panel
// }
// console.flush();
});

/*
Expand Down

0 comments on commit 24c0219

Please sign in to comment.