* Fixed an issue with the moderation button not appearing on some posts. * Added some E2E tests to ensure moderation button is on posts for trusted users. * Added some more tests. * Added a test to ensure moderation button does not appear when logged out.
10 lines
352 B
JavaScript
10 lines
352 B
JavaScript
/**
|
|
* Determines whether or not a member is on the moderation page.
|
|
*
|
|
* @param {String} [path=top.location.pathname] The path to check.
|
|
*
|
|
* @returns {Boolean} True if the path is the moderation page, false otherwise.
|
|
**/
|
|
export function isModerationPage(path = top.location.pathname) {
|
|
return path.endsWith('/mod') || path.endsWith('/mod/');
|
|
}
|