Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified images/cta/donate-appeal.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"name": "session-desktop",
"productName": "Session",
"description": "Private messaging from your desktop",
"version": "1.18.0",
"version": "1.18.1",
"license": "GPL-3.0",
"author": {
"name": "Session Foundation",
Expand Down
4 changes: 2 additions & 2 deletions ts/components/dialog/SessionCTA.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ const StyledDonateAppealTitleContainer = styled(Localizer)`
`;

function DonateAppealTitle() {
return <StyledDonateAppealTitleContainer token="finalAppeal" />;
return <StyledDonateAppealTitleContainer token="ongoingAppeal" />;
}

function getTitle(variant: CTAVariantExcludingProCTAs) {
Expand Down Expand Up @@ -226,7 +226,7 @@ function getDescription(variant: CTAVariantExcludingProCTAs) {
return <Localizer token="donateSessionDescription" />;

case CTAVariant.DONATE_APPEAL:
return <Localizer token="finalAppealDescription" />;
return <Localizer token="ongoingAppealDescription" />;

default:
assertUnreachable(variant, 'CtaTitle');
Expand Down
2 changes: 1 addition & 1 deletion ts/localization
31 changes: 23 additions & 8 deletions ts/node/migration/sessionMigrations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ const LOKI_SCHEMA_VERSIONS: Array<(currentVersion: number, db: Database) => void
updateToSessionSchemaVersion53,
updateToSessionSchemaVersion54,
updateToSessionSchemaVersion55,
updateToSessionSchemaVersion56,
];

function updateToSessionSchemaVersion1(currentVersion: number, db: Database) {
Expand Down Expand Up @@ -2398,30 +2399,26 @@ async function updateToSessionSchemaVersion54(currentVersion: number, db: Databa
console.log(`updateToSessionSchemaVersion${targetVersion}: success!`);
}

async function updateToSessionSchemaVersion55(currentVersion: number, db: Database) {
const targetVersion = 55;
if (currentVersion >= targetVersion) {
return;
}
async function removeDonateAppealCTAReadFlag(targetVersion: number, db: Database) {
console.log(`updateToSessionSchemaVersion${targetVersion}: starting...`);

db.transaction(() => {
const ctaInteractions = sqlNode.getItemById(SettingsKey.ctaInteractions, db)?.value ?? [];
console.log(
`updateToSessionSchemaVersion55 ${SettingsKey.ctaInteractions} before: ${JSON.stringify(ctaInteractions)}`
`updateToSessionSchemaVersion${targetVersion} ${SettingsKey.ctaInteractions} before: ${JSON.stringify(ctaInteractions)}`
);

const idx = ctaInteractions.findIndex((i: any) => i?.variant === CTAVariant.DONATE_APPEAL);
if (idx !== -1) {
ctaInteractions.splice(idx, 1);
console.log(
`updateToSessionSchemaVersion55 removed ${CTAVariant.DONATE_APPEAL} from ${SettingsKey.ctaInteractions}`
`updateToSessionSchemaVersion${targetVersion} removed ${CTAVariant.DONATE_APPEAL} from ${SettingsKey.ctaInteractions}`
);
sqlNode.createOrUpdateItem({ id: SettingsKey.ctaInteractions, value: ctaInteractions }, db);
}

console.log(
`updateToSessionSchemaVersion55 ${SettingsKey.ctaInteractions} after: ${JSON.stringify(sqlNode.getItemById(SettingsKey.ctaInteractions, db)?.value ?? [])}`
`updateToSessionSchemaVersion${targetVersion} ${SettingsKey.ctaInteractions} after: ${JSON.stringify(sqlNode.getItemById(SettingsKey.ctaInteractions, db)?.value ?? [])}`
);

writeSessionSchemaVersion(targetVersion, db);
Expand All @@ -2430,6 +2427,24 @@ async function updateToSessionSchemaVersion55(currentVersion: number, db: Databa
console.log(`updateToSessionSchemaVersion${targetVersion}: success!`);
}

async function updateToSessionSchemaVersion55(currentVersion: number, db: Database) {
const targetVersion = 55;
if (currentVersion >= targetVersion) {
return;
}
await removeDonateAppealCTAReadFlag(targetVersion, db);
}

// Note: updateToSessionSchemaVersion55 and updateToSessionSchemaVersion56 are the same,
// but run at different times to make the donate appeal CTA show up again.
async function updateToSessionSchemaVersion56(currentVersion: number, db: Database) {
const targetVersion = 56;
if (currentVersion >= targetVersion) {
return;
}
await removeDonateAppealCTAReadFlag(targetVersion, db);
}

export function printTableColumns(table: string, db: Database) {
console.info(db.pragma(`table_info('${table}');`));
}
Expand Down
Loading