Invite Message clean up

This commit is contained in:
Natsumi
2021-02-08 22:36:27 +13:00
parent 2ae6fac3a0
commit 02d5b3f343
+6 -11
View File
@@ -8316,11 +8316,7 @@ speechSynthesis.getVoices();
await API.editInviteMessage(params, messageType, slot).catch((err) => { await API.editInviteMessage(params, messageType, slot).catch((err) => {
throw err; throw err;
}).then((args) => { }).then((args) => {
return args; this.$emit(`INVITE:${messageType.toUpperCase()}`, args);
});
await API.refreshInviteMessageTableData(messageType).catch((err) => {
throw err;
}).then((args) => {
if (args.json[slot].message !== D.newMessage) { if (args.json[slot].message !== D.newMessage) {
this.$message({ this.$message({
message: 'VRChat API didn\'t update message, try again', message: 'VRChat API didn\'t update message, try again',
@@ -8330,9 +8326,9 @@ speechSynthesis.getVoices();
} else { } else {
this.$message('Invite message updated'); this.$message('Invite message updated');
} }
return args;
}); });
} }
var I = this.sendInviteResponseDialog; var I = this.sendInviteResponseDialog;
var params = { var params = {
responseSlot: slot, responseSlot: slot,
@@ -8486,11 +8482,7 @@ speechSynthesis.getVoices();
await API.editInviteMessage(params, messageType, slot).catch((err) => { await API.editInviteMessage(params, messageType, slot).catch((err) => {
throw err; throw err;
}).then((args) => { }).then((args) => {
return args; this.$emit(`INVITE:${messageType.toUpperCase()}`, args);
});
await API.refreshInviteMessageTableData(messageType).catch((err) => {
throw err;
}).then((args) => {
if (args.json[slot].message !== D.newMessage) { if (args.json[slot].message !== D.newMessage) {
this.$message({ this.$message({
message: 'VRChat API didn\'t update message, try again', message: 'VRChat API didn\'t update message, try again',
@@ -8500,6 +8492,7 @@ speechSynthesis.getVoices();
} else { } else {
this.$message('Invite message updated'); this.$message('Invite message updated');
} }
return args;
}); });
} }
var I = this.sendInviteDialog; var I = this.sendInviteDialog;
@@ -8511,6 +8504,7 @@ speechSynthesis.getVoices();
this.$message('Invite message sent'); this.$message('Invite message sent');
return args; return args;
}); });
this.sendInviteDialogVisible = false;
} else if (I.messageType === 'requestInvite') { } else if (I.messageType === 'requestInvite') {
I.params.requestSlot = slot; I.params.requestSlot = slot;
API.sendRequestInvite(I.params, I.userId).catch((err) => { API.sendRequestInvite(I.params, I.userId).catch((err) => {
@@ -8519,6 +8513,7 @@ speechSynthesis.getVoices();
this.$message('Request invite message sent'); this.$message('Request invite message sent');
return args; return args;
}); });
this.sendInviteRequestDialogVisible = false;
} }
}; };