mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 06:28:51 +00:00
fix(resources/messages): fix coercion comparsion
This commit is contained in:
1 parent
ea69ba4667
commit
b92cf0d6fa
3 files changed
+5
-4
No files matched your search
@@ -85,6 +85,7 @@ RegisterCommand(
|
|||||||
async () => {
|
async () => {
|
||||||
await hidePhone();
|
await hidePhone();
|
||||||
sendMessage('PHONE', 'phoneRestart', {});
|
sendMessage('PHONE', 'phoneRestart', {});
|
||||||
|
fetchOnInitialize();
|
||||||
},
|
},
|
||||||
false,
|
false,
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ export class _MessagesDB {
|
|||||||
const messages = <Message[]>results;
|
const messages = <Message[]>results;
|
||||||
return messages.map((message) => ({
|
return messages.map((message) => ({
|
||||||
...message,
|
...message,
|
||||||
isMine: message.user_identifier === userIdentifier,
|
isMine: message.user_identifier == userIdentifier,
|
||||||
updatedAt: message.updatedAt.toString(),
|
updatedAt: message.updatedAt.toString(),
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ export async function getConsolidatedMessageGroups(
|
|||||||
(mapping: MessageGroupMapping, messageGroup: UnformattedMessageGroup) => {
|
(mapping: MessageGroupMapping, messageGroup: UnformattedMessageGroup) => {
|
||||||
const groupId = messageGroup.group_id;
|
const groupId = messageGroup.group_id;
|
||||||
const displayTerm = messageGroup.display || messageGroup.phone_number || '???';
|
const displayTerm = messageGroup.display || messageGroup.phone_number || '???';
|
||||||
const isUser = messageGroup.participant_identifier === userIdentifier;
|
const isUser = messageGroup.participant_identifier == userIdentifier;
|
||||||
// Is already mapped?
|
// Is already mapped?
|
||||||
if (groupId in mapping) {
|
if (groupId in mapping) {
|
||||||
// Add participant phone number
|
// Add participant phone number
|
||||||
@@ -77,7 +77,7 @@ export async function getGroupIds(
|
|||||||
): Promise<string[]> {
|
): Promise<string[]> {
|
||||||
const groupIds: string[] = [];
|
const groupIds: string[] = [];
|
||||||
for (const groupId of Object.keys(groupMapping)) {
|
for (const groupId of Object.keys(groupMapping)) {
|
||||||
const isMine = groupMapping[groupId].user_identifier === userIdentifier;
|
const isMine = groupMapping[groupId].user_identifier == userIdentifier;
|
||||||
if (isMine || (await MessagesDB.getMessageCountByGroup(groupId)) > 0) {
|
if (isMine || (await MessagesDB.getMessageCountByGroup(groupId)) > 0) {
|
||||||
groupIds.push(groupId);
|
groupIds.push(groupId);
|
||||||
}
|
}
|
||||||
@@ -163,7 +163,7 @@ export async function createMessageGroupsFromPhoneNumbers(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// don't allow explicitly adding yourself
|
// don't allow explicitly adding yourself
|
||||||
if (identifiers.some((identifier) => identifier === userIdentifier)) {
|
if (identifiers.some((identifier) => identifier == userIdentifier)) {
|
||||||
return { error: true, mine: true, failedNumbers };
|
return { error: true, mine: true, failedNumbers };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user