feat(Relationships): Change enum

This commit is contained in:
March 7th
2022-07-23 18:55:53 +07:00
parent 821b7d0ee4
commit 97db955466
3 changed files with 17 additions and 7 deletions

View File

@@ -126,7 +126,7 @@ class RelationshipsManager {
*/
cancelFriendRequest(user) {
const id = this.resolveId(user);
if (this.cache.get(id) !== RelationshipTypes.OUTGOING_REQUEST) return false;
if (this.cache.get(id) !== RelationshipTypes.PENDING_OUTGOING) return false;
return this.__cancel(id);
}
@@ -145,7 +145,7 @@ class RelationshipsManager {
// Check if already friends
if (this.cache.get(id) === RelationshipTypes.FRIEND) return false;
// Check if outgoing request
if (this.cache.get(id) === RelationshipTypes.OUTGOING_REQUEST) return false;
if (this.cache.get(id) === RelationshipTypes.PENDING_OUTGOING) return false;
await this.client.api.users['@me'].relationships[id].put({
data: {
type: RelationshipTypes.FRIEND,