mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
Fix for "ReferenceError: globalPosition is not defined" warning
This commit is contained in:
parent
432bb27119
commit
d2f024e84d
1 changed files with 6 additions and 2 deletions
|
@ -7,7 +7,7 @@ Item {
|
|||
property var eventBridge;
|
||||
|
||||
signal showDesktop();
|
||||
|
||||
|
||||
function loadSource(url) {
|
||||
loader.source = url;
|
||||
}
|
||||
|
@ -23,7 +23,11 @@ Item {
|
|||
}
|
||||
|
||||
function playButtonClickSound() {
|
||||
buttonClickSound.play(globalPosition);
|
||||
// Because of the asynchronous nature of initalization, it is possible for this function to be
|
||||
// called before the C++ has set the globalPosition context variable.
|
||||
if (typeof globalPosition !== 'undefined') {
|
||||
buttonClickSound.play(globalPosition);
|
||||
}
|
||||
}
|
||||
|
||||
Loader {
|
||||
|
|
Loading…
Reference in a new issue