Skip to content

Commit

Permalink
Update onNavigation onLoad default to false to prevent doubleloading,…
Browse files Browse the repository at this point in the history
… add onNavigate shortcut, bump version
  • Loading branch information
bradp committed Oct 8, 2023
1 parent 3be6b52 commit 7a2f096
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
8 changes: 5 additions & 3 deletions mousehunt-utils.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// ==UserScript==
// @name 🐭️ MouseHunt Utils
// @author bradp
// @version 1.10.4
// @version 1.10.5
// @description MouseHunt Utils is a library of functions that can be used to make other MouseHunt userscripts easily.
// @license MIT
// @namespace bradp
Expand Down Expand Up @@ -610,7 +610,7 @@ const matchesCurrentPage = (targetPage = null, targetTab = null, targetSubtab =
onNavigation(() => console.log('hunter profile, but not when refreshing the page'),
{
page: 'hunterprofile',
onLoad: false
onLoad: true
}
);
*/
Expand All @@ -630,7 +630,7 @@ const onNavigation = (callback, options = {}) => {
page: false,
tab: false,
subtab: false,
onLoad: true,
onLoad: false,
};

// merge the defaults with the options
Expand Down Expand Up @@ -682,6 +682,8 @@ const onNavigation = (callback, options = {}) => {
});
};

const onNavigate = onNavigation;

/**
* Get the current page slug.
*
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mousehunt-utils",
"version": "1.10.4",
"version": "1.10.5",
"description": "",
"main": "mousehunt-utils.js",
"scripts": {
Expand Down

0 comments on commit 7a2f096

Please sign in to comment.