mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 03:44:02 +02:00
Merge pull request #6789 from jherico/url_loop
Stop looping on URL fixing
This commit is contained in:
commit
3e8f26d591
1 changed files with 10 additions and 0 deletions
|
@ -47,10 +47,20 @@ VrDialog {
|
|||
anchors.fill: parent
|
||||
focus: true
|
||||
|
||||
property var originalUrl
|
||||
property var lastFixupTime: 0
|
||||
|
||||
onUrlChanged: {
|
||||
var currentUrl = url.toString();
|
||||
var newUrl = urlHandler.fixupUrl(currentUrl).toString();
|
||||
if (newUrl != currentUrl) {
|
||||
var now = new Date().valueOf();
|
||||
if (url === originalUrl && (now - lastFixupTime < 100)) {
|
||||
console.warn("URL fixup loop detected")
|
||||
return;
|
||||
}
|
||||
originalUrl = url
|
||||
lastFixupTime = now
|
||||
url = newUrl;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue