Skip to content

Commit 8c3d7fb

Browse files
committed
Update object selection
Allows user to clear the highlight from the object by clicking on the object again.
1 parent 5958e50 commit 8c3d7fb

2 files changed

Lines changed: 10 additions & 11 deletions

File tree

spa/src/components/Chat.vue

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -857,7 +857,6 @@ export default Vue.extend({
857857
}
858858
},
859859
changeActivePanel(): void {
860-
this.selectedId = null;
861860
this.backpackObjects = [];
862861
switch (this.activePanel) {
863862
case "users":
@@ -1234,11 +1233,9 @@ export default Vue.extend({
12341233
},
12351234
deep: true,
12361235
},
1237-
clickId(newValue, oldValue) {
1238-
if(newValue) {
1239-
this.selectedId = newValue;
1240-
this.activePanel = 'sharedObjects';
1241-
}
1236+
clickId(newValue) {
1237+
this.selectedId = newValue;
1238+
this.activePanel = 'sharedObjects';
12421239
},
12431240
async activePanel() {
12441241
if(this.activePanel === 'backpack') {

spa/src/pages/world-browser/WorldBrowserPage.vue

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -184,11 +184,13 @@ export default Vue.extend({
184184
});
185185
sharedObject.addFieldCallback("touchTime", {}, (_t) => {
186186
if(obj.id){
187-
if(/\D/.test(obj.id)){
188-
// user avatar clicked.
189-
} else {
190-
this.clickId = obj.id;
191-
}
187+
if(obj.id === this.clickId){
188+
this.clickId = null;
189+
} else {
190+
this.clickId = obj.id;
191+
}
192+
} else {
193+
this.clickId = null;
192194
}
193195
});
194196
this.sharedObjectsMap.set(obj.id, sharedObject);

0 commit comments

Comments
 (0)