Skip to content

Commit 7ad2c44

Browse files
SalleeMatthewsmile0711
authored andcommitted
Fix Method
Removed the "as any" casting on the entire method block for Chat and NeighborhoodMapPage. Updated menuToggleXp variable.
1 parent 8ab8cb5 commit 7ad2c44

3 files changed

Lines changed: 98 additions & 17 deletions

File tree

spa/src/components/Chat.vue

Lines changed: 95 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@
216216
:active-panel-users="activePanel === 'users'"
217217
:menu-go-to="menuGoTo"
218218
:menu-toggle-role="menuToggleRole"
219-
:menu-toggle-xp="menuToggleXP"
219+
:menu-toggle-xp="menuToggleXp"
220220
:menu-toggle-speech="menuToggleSpeech"
221221
:menu-beam-to="menuBeamTo"
222222
:menu-whisper="menuWhisper"
@@ -254,18 +254,100 @@
254254
import Vue from 'vue';
255255
import { debugMsg } from '@/helpers';
256256
import UserMenu from './UserMenu.vue';
257-
export default Vue.extend({
257+
258+
interface ChatData {
259+
message: string;
260+
messages: any[];
261+
users: any[];
262+
backpackObjects: any[];
263+
primaryRole: string;
264+
displayRole: boolean;
265+
xpAmount: number;
266+
activePanel: string;
267+
objectId: any;
268+
canInteractWithObject: boolean;
269+
canModify: boolean;
270+
memberId: any;
271+
username: any;
272+
usernameBackPack: any;
273+
blockedUser: boolean;
274+
blockedMembers: any[];
275+
cursorX: any;
276+
cursorY: any;
277+
numberOfPosts: number;
278+
userMenu: boolean;
279+
menuTop: any;
280+
menuLeft: any;
281+
menuBottom: any;
282+
menuBeamTo: boolean;
283+
menuWhisper: boolean;
284+
menuInviteChat: boolean;
285+
menuIgnore: boolean;
286+
menuDrop: boolean;
287+
menuMove: boolean;
288+
menuTake: boolean;
289+
menuBuy: boolean;
290+
menuDestroy: boolean;
291+
menuProperties: boolean;
292+
menuRequestBackpack: boolean;
293+
menuGoTo: boolean;
294+
menuToggleRole: boolean;
295+
menuToggleXp: boolean;
296+
menuToggleSpeech: boolean;
297+
mallObject: boolean;
298+
activePlaces: any[];
299+
placeList: any[];
300+
placeType: any;
301+
placeUsername: any;
302+
placeSlug: any;
303+
placeId: any;
304+
chatIntervalId: any;
305+
pingIntervalId: any;
306+
worldMembers: any[];
307+
chatEnabled: boolean;
308+
showRole: boolean;
309+
showXP: boolean;
310+
tts: boolean;
311+
virtualPet: any;
312+
virtualPetDirectly: any[];
313+
virtualPetWhisper: any[];
314+
virtualPetBeam: any[];
315+
virtualPetMessageData: any[];
316+
virtualPetInputs: any[][];
317+
virtualPetOutputs: any[][];
318+
virtualPetDefault: any[];
319+
entryMessageCode: number;
320+
selectedId: any;
321+
}
322+
323+
interface ChatMethods {
324+
[key: string]: (...args: any[]) => any;
325+
}
326+
327+
interface ChatComputed {
328+
connected: boolean;
329+
}
330+
331+
export default Vue.extend<ChatData, ChatMethods, ChatComputed, Record<string, any>>({
258332
name: "Chat",
259333
components: {
260334
UserMenu,
261335
},
262-
props: [
263-
"place",
264-
"sharedEvent",
265-
"sharedObjects",
266-
"clickId",
267-
],
268-
data: () => {
336+
props: {
337+
place: {
338+
default: null,
339+
},
340+
sharedEvent: {
341+
default: null,
342+
},
343+
sharedObjects: {
344+
default: null,
345+
},
346+
clickId: {
347+
default: null,
348+
},
349+
},
350+
data(): ChatData {
269351
return {
270352
message: "",
271353
messages: [],
@@ -303,7 +385,7 @@ export default Vue.extend({
303385
menuRequestBackpack: true,
304386
menuGoTo: false,
305387
menuToggleRole: false,
306-
menuToggleXP: false,
388+
menuToggleXp: false,
307389
menuToggleSpeech: false,
308390
mallObject: false,
309391
activePlaces: [],
@@ -486,7 +568,7 @@ export default Vue.extend({
486568
this.menuRequestBackpack = false;
487569
this.menuGoTo = false;
488570
this.menuToggleRole = false;
489-
this.menuToggleXP = false;
571+
this.menuToggleXp = false;
490572
this.menuToggleSpeech = false;
491573
this.mallObject = false;
492574
this.placeType = null;
@@ -532,7 +614,7 @@ export default Vue.extend({
532614
if(this.activePanel === 'users'){
533615
if(target[0] === this.$store.data.user.id){
534616
this.menuToggleRole = true;
535-
this.menuToggleXP = true;
617+
this.menuToggleXp = true;
536618
this.menuToggleSpeech = true;
537619
} else {
538620
this.menuIgnore = true;
@@ -1064,7 +1146,7 @@ export default Vue.extend({
10641146
this.messages.splice(index, 1);
10651147
}
10661148
},
1067-
} as any,
1149+
},
10681150
watch: {
10691151
place() {
10701152
this.startNewChat();

spa/src/components/UserMenu.vue

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
<input type="checkbox" id="role" :checked="showRole" @change="$emit('role-change', $event.target.checked)" />
5252
<label for="role"> Users Roles</label>
5353
</li>
54-
<li v-show="menuToggleXP || menuToggleXp" class="
54+
<li v-show="menuToggleXp" class="
5555
p-1
5656
pl-3.5
5757
hover:text-white
@@ -219,7 +219,7 @@
219219
</div>
220220
</template>
221221

222-
<script>
222+
<script lang="ts">
223223
export default {
224224
name: "UserMenu",
225225
props: {
@@ -234,7 +234,6 @@ export default {
234234
menuGoTo: Boolean,
235235
menuToggleRole: Boolean,
236236
menuToggleXp: Boolean,
237-
menuToggleXP: Boolean,
238237
menuToggleSpeech: Boolean,
239238
menuBeamTo: Boolean,
240239
menuWhisper: Boolean,

spa/src/pages/neighborhood/NeighborhoodMapPage.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ export default Vue.extend({
9595
this.$store.data.user.token,
9696
);
9797
},
98-
} as any,
98+
},
9999
watch: {},
100100
computed: {
101101
mapBackground() {

0 commit comments

Comments
 (0)