mirror of
https://github.com/flarum/framework.git
synced 2024-11-23 07:22:15 +08:00
Fix scrolling to reply via 'reply'
as near
parameter
This commit is contained in:
parent
d409484abf
commit
f4ad9d2d5a
|
@ -15,7 +15,7 @@ function getDiscussionIdFromSlug(slug: string | undefined) {
|
|||
* in the same discussion.
|
||||
*/
|
||||
export default class DiscussionPageResolver extends DefaultResolver {
|
||||
static scrollToPostNumber: number | null = null;
|
||||
static scrollToPostNumber: string | number | null = null;
|
||||
|
||||
makeKey() {
|
||||
const params = { ...m.route.param() };
|
||||
|
@ -28,7 +28,7 @@ export default class DiscussionPageResolver extends DefaultResolver {
|
|||
|
||||
onmatch(args, requestedPath, route) {
|
||||
if (route.includes('/d/:id') && getDiscussionIdFromSlug(args.id) === getDiscussionIdFromSlug(m.route.param('id'))) {
|
||||
DiscussionPageResolver.scrollToPostNumber = parseInt(args.near);
|
||||
DiscussionPageResolver.scrollToPostNumber = args.near === 'reply' ? 'reply' : parseInt(args.near);
|
||||
}
|
||||
|
||||
return super.onmatch(args, requestedPath, route);
|
||||
|
|
Loading…
Reference in New Issue
Block a user