PR changes

pull/2000/head
Warrick Corfe-Tan 3 years ago
parent 690abb9d52
commit cb5551c1e9

@ -835,7 +835,6 @@ const LOKI_SCHEMA_VERSIONS = [
updateToLokiSchemaVersion14, updateToLokiSchemaVersion14,
updateToLokiSchemaVersion15, updateToLokiSchemaVersion15,
updateToLokiSchemaVersion16, updateToLokiSchemaVersion16,
updateToLokiSchemaVersion17,
]; ];
function updateToLokiSchemaVersion1(currentVersion, db) { function updateToLokiSchemaVersion1(currentVersion, db) {
@ -1229,23 +1228,6 @@ function updateToLokiSchemaVersion16(currentVersion, db) {
console.log(`updateToLokiSchemaVersion${targetVersion}: success!`); console.log(`updateToLokiSchemaVersion${targetVersion}: success!`);
} }
function updateToLokiSchemaVersion17(currentVersion, db) {
const targetVersion = 17;
if (currentVersion >= targetVersion) {
return;
}
console.log(`updateToLokiSchemaVersion${targetVersion}: starting...`);
db.transaction(() => {
db.exec(`
ALTER TABLE ${CONVERSATIONS_TABLE} ADD COLUMN isApproved BOOLEAN;
`);
writeLokiSchemaVersion(targetVersion, db);
})();
console.log(`updateToLokiSchemaVersion${targetVersion}: success!`);
}
function writeLokiSchemaVersion(newVersion, db) { function writeLokiSchemaVersion(newVersion, db) {
db.prepare( db.prepare(
`INSERT INTO loki_schema( `INSERT INTO loki_schema(
@ -1618,7 +1600,6 @@ function updateConversation(data) {
type, type,
members, members,
name, name,
isApproved,
profileName, profileName,
} = data; } = data;
@ -1631,7 +1612,6 @@ function updateConversation(data) {
type = $type, type = $type,
members = $members, members = $members,
name = $name, name = $name,
isApproved = $isApproved,
profileName = $profileName profileName = $profileName
WHERE id = $id;` WHERE id = $id;`
) )
@ -1643,7 +1623,6 @@ function updateConversation(data) {
type, type,
members: members ? members.join(' ') : null, members: members ? members.join(' ') : null,
name, name,
isApproved,
profileName, profileName,
}); });
} }

@ -312,12 +312,11 @@ export class LeftPaneMessageSection extends React.Component<Props, State> {
_.forEach(allConversations, convo => { _.forEach(allConversations, convo => {
if (convo.isApproved() !== true) { if (convo.isApproved() !== true) {
convo.setIsApproved(true); BlockedNumberController.block(convo.id);
syncRequired = true; syncRequired = true;
} }
}); });
if (syncRequired) { if (syncRequired) {
// syncConfigurationIfNeeded(true);
await forceSyncConfigurationNowIfNeeded(); await forceSyncConfigurationNowIfNeeded();
} }
}} }}

@ -146,7 +146,7 @@ export interface ConversationAttributesOptionals {
triggerNotificationsFor?: ConversationNotificationSettingType; triggerNotificationsFor?: ConversationNotificationSettingType;
isTrustedForAttachmentDownload?: boolean; isTrustedForAttachmentDownload?: boolean;
isPinned: boolean; isPinned: boolean;
isApproved: boolean; isApproved?: boolean;
} }
/** /**

@ -424,7 +424,6 @@ export const isDuplicate = (
Math.abs(m.attributes.sent_at - testedMessage.timestamp) <= Math.abs(m.attributes.sent_at - testedMessage.timestamp) <=
PUBLICCHAT_MIN_TIME_BETWEEN_DUPLICATE_MESSAGES; PUBLICCHAT_MIN_TIME_BETWEEN_DUPLICATE_MESSAGES;
debugger;
return sameUsername && sameText && timestampsSimilar; return sameUsername && sameText && timestampsSimilar;
}; };

@ -89,7 +89,6 @@ export const forceSyncConfigurationNowIfNeeded = async (waitForMessageSent = fal
resolve(true); resolve(true);
} }
: undefined; : undefined;
console.warn({configMessage});
void getMessageQueue().sendSyncMessage(configMessage, callback as any); void getMessageQueue().sendSyncMessage(configMessage, callback as any);
// either we resolve from the callback if we need to wait for it, // either we resolve from the callback if we need to wait for it,
// or we don't want to wait, we resolve it here. // or we don't want to wait, we resolve it here.

@ -352,22 +352,6 @@ export const getLeftPaneLists = createSelector(
_getLeftPaneLists _getLeftPaneLists
); );
export const getApprovedConversations = createSelector(
getConversationLookup,
(lookup: ConversationLookupType): Array<ReduxConversationType> => {
return Object.values(lookup).filter(convo => convo.isApproved === true);
}
);
export const getUnapprovedConversations = createSelector(
getConversationLookup,
(lookup: ConversationLookupType): Array<ReduxConversationType> => {
return Object.values(lookup).filter(
convo => convo.isApproved === false || convo.isApproved === undefined
);
}
);
export const getMe = createSelector( export const getMe = createSelector(
[getConversationLookup, getOurNumber], [getConversationLookup, getOurNumber],
(lookup: ConversationLookupType, ourNumber: string): ReduxConversationType => { (lookup: ConversationLookupType, ourNumber: string): ReduxConversationType => {

Loading…
Cancel
Save