mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Don't transition miniprofiler on first page load. (#14265)
See https://meta.discourse.org/t/-/202482/5
This commit is contained in:
committed by
GitHub
parent
fc1fd1b416
commit
aaa8a379b9
@@ -15,8 +15,8 @@ export default {
|
||||
const router = container.lookup("router:main");
|
||||
|
||||
router.on("routeWillChange", viewTrackingRequired);
|
||||
router.on("routeDidChange", () => {
|
||||
cleanDOM(container);
|
||||
router.on("routeDidChange", (transition) => {
|
||||
cleanDOM(container, { skipMiniProfilerPageTransition: !transition.from });
|
||||
});
|
||||
|
||||
let appEvents = container.lookup("service:app-events");
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { scheduleOnce } from "@ember/runloop";
|
||||
|
||||
function _clean() {
|
||||
if (window.MiniProfiler) {
|
||||
function _clean(opts = {}) {
|
||||
if (window.MiniProfiler && !opts.skipMiniProfilerPageTransition) {
|
||||
window.MiniProfiler.pageTransition();
|
||||
}
|
||||
|
||||
@@ -29,6 +29,6 @@ function _clean() {
|
||||
this.lookup("service:document-title").updateContextCount(0);
|
||||
}
|
||||
|
||||
export function cleanDOM(container) {
|
||||
scheduleOnce("afterRender", container, _clean);
|
||||
export function cleanDOM(container, opts) {
|
||||
scheduleOnce("afterRender", container, _clean, opts);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user