mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-26 02:03:49 +02:00
Fix invite stuff
This commit is contained in:
@@ -61,11 +61,12 @@
|
||||
}
|
||||
|
||||
async function saveEditAndSendInviteResponse() {
|
||||
const I = props.sendInviteResponseDialog;
|
||||
const D = props.editAndSendInviteResponseDialog;
|
||||
D.visible = false;
|
||||
const messageType = D.messageType;
|
||||
const slot = D.inviteMessage.slot;
|
||||
if (D.inviteMessage.message !== D.newMessage) {
|
||||
const messageType = I.messageSlot.messageType;
|
||||
const slot = I.messageSlot.slot;
|
||||
if (I.messageSlot.message !== D.newMessage) {
|
||||
const params = {
|
||||
message: D.newMessage
|
||||
};
|
||||
@@ -88,7 +89,6 @@
|
||||
return args;
|
||||
});
|
||||
}
|
||||
const I = props.sendInviteResponseDialog;
|
||||
const params = {
|
||||
responseSlot: slot,
|
||||
rsvp: true
|
||||
@@ -107,9 +107,10 @@
|
||||
message: 'Invite response message sent',
|
||||
type: 'success'
|
||||
});
|
||||
|
||||
emit('closeInviteDialog');
|
||||
return args;
|
||||
})
|
||||
.finally(() => {
|
||||
emit('closeInviteDialog');
|
||||
});
|
||||
} else {
|
||||
notificationRequest
|
||||
@@ -125,8 +126,10 @@
|
||||
message: 'Invite response message sent',
|
||||
type: 'success'
|
||||
});
|
||||
emit('closeInviteDialog');
|
||||
return args;
|
||||
})
|
||||
.finally(() => {
|
||||
emit('closeInviteDialog');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
@click.stop="showEditAndSendInviteResponseDialog('requestResponse', scope.row)">
|
||||
@click.stop="showEditAndSendInviteResponseDialog(scope.row)">
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -50,11 +50,13 @@
|
||||
<EditAndSendInviteResponseDialog
|
||||
:edit-and-send-invite-response-dialog.sync="editAndSendInviteResponseDialog"
|
||||
:upload-image="uploadImage"
|
||||
:send-invite-response-dialog="sendInviteResponseDialog" />
|
||||
:send-invite-response-dialog.sync="sendInviteResponseDialog"
|
||||
@closeInviteDialog="closeInviteDialog" />
|
||||
<SendInviteResponseConfirmDialog
|
||||
:send-invite-response-confirm-dialog="sendInviteResponseConfirmDialog"
|
||||
:send-invite-response-dialog.sync="sendInviteResponseDialog"
|
||||
:upload-image="uploadImage"
|
||||
:send-invite-response-dialog.sync="sendInviteResponseDialog" />
|
||||
:send-invite-response-confirm-dialog="sendInviteResponseConfirmDialog"
|
||||
@closeInviteDialog="closeInviteDialog" />
|
||||
</safe-dialog>
|
||||
</template>
|
||||
|
||||
@@ -67,6 +69,7 @@
|
||||
const { t } = useI18n();
|
||||
|
||||
const API = inject('API');
|
||||
const inviteImageUpload = inject('inviteImageUpload');
|
||||
|
||||
defineProps({
|
||||
sendInviteRequestResponseDialogVisible: {
|
||||
@@ -82,12 +85,10 @@
|
||||
}
|
||||
});
|
||||
|
||||
const emit = defineEmits(['update:sendInviteRequestResponseDialogVisible', 'inviteImageUpload']);
|
||||
const emit = defineEmits(['update:sendInviteRequestResponseDialogVisible']);
|
||||
|
||||
const editAndSendInviteResponseDialog = ref({
|
||||
visible: false,
|
||||
inviteMessage: {},
|
||||
messageType: '',
|
||||
newMessage: ''
|
||||
});
|
||||
|
||||
@@ -96,27 +97,25 @@
|
||||
});
|
||||
|
||||
const sendInviteResponseDialog = ref({
|
||||
message: '',
|
||||
messageSlot: 0,
|
||||
messageSlot: {},
|
||||
invite: {}
|
||||
});
|
||||
|
||||
function inviteImageUpload(event) {
|
||||
emit('inviteImageUpload', event);
|
||||
function showEditAndSendInviteResponseDialog(row) {
|
||||
props.sendInviteResponseDialog.messageSlot = row;
|
||||
editAndSendInviteResponseDialog.value = {
|
||||
newMessage: messageSlot.message,
|
||||
visible: true
|
||||
};
|
||||
}
|
||||
|
||||
function showSendInviteResponseConfirmDialog(row) {
|
||||
props.sendInviteResponseDialog.messageSlot = row;
|
||||
sendInviteResponseConfirmDialog.value.visible = true;
|
||||
sendInviteResponseDialog.value.messageSlot = row.slot;
|
||||
}
|
||||
|
||||
function showEditAndSendInviteResponseDialog(messageType, inviteMessage) {
|
||||
editAndSendInviteResponseDialog.value = {
|
||||
newMessage: inviteMessage.message,
|
||||
visible: true,
|
||||
messageType,
|
||||
inviteMessage
|
||||
};
|
||||
function closeInviteDialog() {
|
||||
cancelSendInviteRequestResponse();
|
||||
}
|
||||
|
||||
function cancelSendInviteRequestResponse() {
|
||||
|
||||
@@ -31,16 +31,16 @@
|
||||
const $message = instance.proxy.$message;
|
||||
|
||||
const props = defineProps({
|
||||
sendInviteResponseConfirmDialog: {
|
||||
sendInviteResponseDialog: {
|
||||
type: Object,
|
||||
required: true
|
||||
default: () => ({})
|
||||
},
|
||||
uploadImage: {
|
||||
type: String
|
||||
},
|
||||
sendInviteResponseDialog: {
|
||||
sendInviteResponseConfirmDialog: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
required: true
|
||||
}
|
||||
});
|
||||
|
||||
@@ -48,17 +48,19 @@
|
||||
|
||||
function cancelInviteResponseConfirm() {
|
||||
emit('update:sendInviteResponseConfirmDialog', { visible: false });
|
||||
// TODO: temp fix to close dialog
|
||||
props.sendInviteResponseConfirmDialog.visible = false;
|
||||
}
|
||||
|
||||
function sendInviteResponseConfirm() {
|
||||
const D = props.sendInviteResponseDialog;
|
||||
const params = {
|
||||
responseSlot: D.messageSlot,
|
||||
responseSlot: D.messageSlot.slot,
|
||||
rsvp: true
|
||||
};
|
||||
if (props.uploadImage) {
|
||||
notificationRequest
|
||||
.sendInviteResponsePhoto(params, D.invite.id, D.messageType)
|
||||
.sendInviteResponsePhoto(params, D.invite.id, D.messageSlot.messageType)
|
||||
.catch((err) => {
|
||||
throw err;
|
||||
})
|
||||
@@ -71,10 +73,13 @@
|
||||
type: 'success'
|
||||
});
|
||||
return args;
|
||||
})
|
||||
.finally(() => {
|
||||
emit('closeInviteDialog');
|
||||
});
|
||||
} else {
|
||||
notificationRequest
|
||||
.sendInviteResponse(params, D.invite.id, D.messageType)
|
||||
.sendInviteResponse(params, D.invite.id, D.messageSlot.messageType)
|
||||
.catch((err) => {
|
||||
throw err;
|
||||
})
|
||||
@@ -87,9 +92,11 @@
|
||||
type: 'success'
|
||||
});
|
||||
return args;
|
||||
})
|
||||
.finally(() => {
|
||||
emit('closeInviteDialog');
|
||||
});
|
||||
}
|
||||
cancelInviteResponseConfirm();
|
||||
emit('closeInviteDialog');
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
@click.stop="showEditAndSendInviteResponseDialog('response', scope.row)" />
|
||||
@click.stop="showEditAndSendInviteResponseDialog(scope.row)" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
</data-tables>
|
||||
@@ -52,11 +52,13 @@
|
||||
<EditAndSendInviteResponseDialog
|
||||
:edit-and-send-invite-response-dialog.sync="editAndSendInviteResponseDialog"
|
||||
:upload-image="uploadImage"
|
||||
:send-invite-response-confirm-dialog="sendInviteResponseDialog" />
|
||||
:send-invite-response-dialog.sync="sendInviteResponseDialog"
|
||||
@closeInviteDialog="closeInviteDialog" />
|
||||
<SendInviteResponseConfirmDialog
|
||||
:send-invite-response-dialog.sync="sendInviteResponseConfirmDialog"
|
||||
:send-invite-response-dialog.sync="sendInviteResponseDialog"
|
||||
:upload-image="uploadImage"
|
||||
:send-invite-response-confirm-dialog="sendInviteResponseDialog" />
|
||||
:send-invite-response-confirm-dialog="sendInviteResponseConfirmDialog"
|
||||
@closeInviteDialog="closeInviteDialog" />
|
||||
</safe-dialog>
|
||||
</template>
|
||||
|
||||
@@ -69,7 +71,12 @@
|
||||
const { t } = useI18n();
|
||||
|
||||
const API = inject('API');
|
||||
defineProps({
|
||||
const inviteImageUpload = inject('inviteImageUpload');
|
||||
const props = defineProps({
|
||||
sendInviteResponseDialog: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
},
|
||||
sendInviteResponseDialogVisible: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
@@ -85,42 +92,33 @@
|
||||
|
||||
const editAndSendInviteResponseDialog = ref({
|
||||
visible: false,
|
||||
inviteMessage: {},
|
||||
messageType: '',
|
||||
newMessage: ''
|
||||
});
|
||||
|
||||
const emit = defineEmits(['update:sendInviteResponseDialogVisible', 'inviteImageUpload']);
|
||||
const emit = defineEmits(['update:sendInviteResponseDialogVisible']);
|
||||
|
||||
const sendInviteResponseConfirmDialog = ref({
|
||||
visible: false
|
||||
});
|
||||
|
||||
const sendInviteResponseDialog = ref({
|
||||
message: '',
|
||||
messageSlot: 0,
|
||||
invite: {}
|
||||
});
|
||||
function closeInviteDialog() {
|
||||
cancelSendInviteResponse();
|
||||
}
|
||||
|
||||
function cancelSendInviteResponse() {
|
||||
emit('update:sendInviteResponseDialogVisible', false);
|
||||
}
|
||||
|
||||
function showEditAndSendInviteResponseDialog(messageType, inviteMessage) {
|
||||
function showEditAndSendInviteResponseDialog(row) {
|
||||
props.sendInviteResponseDialog.messageSlot = row;
|
||||
editAndSendInviteResponseDialog.value = {
|
||||
newMessage: inviteMessage.message,
|
||||
visible: true,
|
||||
messageType,
|
||||
inviteMessage
|
||||
newMessage: messageSlot.message,
|
||||
visible: true
|
||||
};
|
||||
}
|
||||
|
||||
function inviteImageUpload(event) {
|
||||
emit('inviteImageUpload', event);
|
||||
}
|
||||
|
||||
function showSendInviteResponseConfirmDialog(row) {
|
||||
props.sendInviteResponseDialog.messageSlot = row;
|
||||
sendInviteResponseConfirmDialog.value.visible = true;
|
||||
sendInviteResponseDialog.value.messageSlot = row.slot;
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user