don't save tablet to Settings when logging out or switching domains

This commit is contained in:
Seth Alves 2017-01-19 14:10:48 -08:00
parent 18e9b476c5
commit 47b59ffae3
3 changed files with 8 additions and 2 deletions

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() {