[FIX] website: fix traceback when refreshing with f5 or ctrl+r

[1] removed the `router.redirect` method but [2] which was forward
ported after from 16.0 used the redirect method where it still existed.

This causes a traceback when using f5 or ctrl+r.

This commit fixes that by using the proper method in 16.2+

[1]: https://github.com/odoo/odoo/commit/365fe390fdc814bc079419f0bd940b8edd652618
[2]: https://github.com/odoo/odoo/commit/45affc3a94f33478063d2e82be5e0c51df92fb5f

task-3458691

closes odoo/odoo#134764

X-original-commit: dec96bca556b8df23fb692587cb64b47a6a3206b
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
This commit is contained in:
Arthur Detroux (ard)
2023-09-08 09:47:08 +00:00
parent 49f6fc10e9
commit d8d71c5ce6
@@ -498,8 +498,8 @@ export class WebsitePreview extends Component {
}
ev.preventDefault();
const path = this.websiteService.contentWindow.location;
const debugMode = this.env.debug ? `?debug=${odoo.debug}` : "";
this.router.redirect(
const debugMode = this.env.debug ? `?debug=${this.env.debug}` : "";
browser.location.assign(
`/web${debugMode}#action=website.website_preview&path=${encodeURIComponent(path)}`
);
}