PR changes

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

@ -835,7 +835,6 @@ const LOKI_SCHEMA_VERSIONS = [
updateToLokiSchemaVersion14,
updateToLokiSchemaVersion15,
updateToLokiSchemaVersion16,
updateToLokiSchemaVersion17,
];
function updateToLokiSchemaVersion1(currentVersion, db) {
@ -1229,23 +1228,6 @@ function updateToLokiSchemaVersion16(currentVersion, db) {
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) {
db.prepare(
`INSERT INTO loki_schema(
@ -1618,7 +1600,6 @@ function updateConversation(data) {
type,
members,
name,
isApproved,
profileName,
} = data;
@ -1631,7 +1612,6 @@ function updateConversation(data) {
type = $type,
members = $members,
name = $name,
isApproved = $isApproved,
profileName = $profileName
WHERE id = $id;`
)
@ -1643,7 +1623,6 @@ function updateConversation(data) {
type,
members: members ? members.join(' ') : null,
name,
isApproved,
profileName,
});
}

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

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

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

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

@ -352,22 +352,6 @@ export const getLeftPaneLists = createSelector(
_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(
[getConversationLookup, getOurNumber],
(lookup: ConversationLookupType, ourNumber: string): ReduxConversationType => {

Loading…
Cancel
Save