feat(resources/messages): server and client functionality for alerts

This commit is contained in:
Christopher committed 2021-02-28 01:37:22 +01:00
1 parent ec913fbef4
commit 09d397b6cf
3 files changed
+15 -17

No files matched your search

+9 -14
View File
@@ -412,18 +412,7 @@ onNet(
label
);
if (result.error) {
// if it just fails, welp
emitNet(events.MESSAGES_CREATE_MESSAGE_GROUP_FAILED, _source, result);
/*emitNet(events.MESSAGES_ACTION_RESULT, _source, {
message: `MESSAGES_MESSAGE_GROUP_CREATE_FAILED:`,
type: 'error',
});*/
console.log(result);
// if you try to create a existing group
} else if (result.error && result.duplicate) {
if (result.error && result.duplicate) {
emitNet(events.MESSAGES_ACTION_RESULT, _source, {
message: 'MESSAGES_MESSAGE_GROUP_DUPLICATE',
type: 'error',
@@ -432,17 +421,23 @@ onNet(
// if the phoneNumber is invalid
} else if (result.error && result.phoneNumber) {
emitNet(events.MESSAGES_ACTION_RESULT, _source, {
message: 'MESSAGES_INVALID_PHONE_NUMBER' + result.phoneNumber,
message: 'MESSAGES_INVALID_PHONE_NUMBER',
type: 'error',
});
// if you are try to add yourself
} else if (result.error && result.mine) {
console.log('yes');
emitNet(events.MESSAGES_ACTION_RESULT, _source, {
message: 'MESSAGES_MESSAGE_GROUP_CREATE_MINE',
type: 'error',
});
} else if (result.error) {
// if it just fails, welp
emitNet(events.MESSAGES_CREATE_MESSAGE_GROUP_FAILED, _source, result);
emitNet(events.MESSAGES_ACTION_RESULT, _source, {
message: `MESSAGES_MESSAGE_GROUP_CREATE_FAILED:`,
type: 'error',
});
} else {
emitNet(events.MESSAGES_CREATE_MESSAGE_GROUP_SUCCESS, _source, result);
}