Merge pull request from sethalves/tablet-ui

don't save tablet to Settings when logging out or switching domains
This commit is contained in:
Seth Alves 2017-01-19 14:11:14 -08:00 committed by GitHub
commit fc8b09d2b3
3 changed files with 8 additions and 2 deletions
interface/src/avatar
scripts/system
libraries
tablet-ui

View file

@ -796,8 +796,14 @@ void MyAvatar::saveData() {
settings.beginWriteArray("avatarEntityData");
int avatarEntityIndex = 0;
auto hmdInterface = DependencyManager::get<HMDScriptingInterface>();
_avatarEntitiesLock.withReadLock([&] {
for (auto entityID : _avatarEntityData.keys()) {
if (hmdInterface->getCurrentTableUIID() == entityID) {
// don't persist the tablet between domains / sessions
continue;
}
settings.setArrayIndex(avatarEntityIndex);
settings.setValue("id", entityID);
settings.setValue("properties", _avatarEntityData.value(entityID));

View file

@ -136,7 +136,7 @@ WebTablet = function (url, width, dpi, hand, clientOnly) {
this.state = "idle";
this.getRoot = function() {
return Entities.getWebViewRoot(_this.webEntityID);
return Entities.getWebViewRoot(_this.tabletEntityID);
};
this.getLocation = function() {

View file

@ -26,7 +26,7 @@
print("show tablet-ui");
UIWebTablet = new WebTablet("qml/hifi/tablet/TabletRoot.qml", null, null, activeHand, true);
UIWebTablet.register();
HMD.tabletID = UIWebTablet.webEntityID;
HMD.tabletID = UIWebTablet.tabletEntityID;
}
function hideTabletUI() {