Skip to content

Commit 7441677

Browse files
authored
Merge pull request #1942 from session-foundation/cta-last-appeal
chore: last appeal changes & string & bump to 1.18.0
2 parents 4047a10 + 300f292 commit 7441677

6 files changed

Lines changed: 47 additions & 9 deletions

File tree

images/cta/donate-appeal.webp

-99.4 KB
Loading

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"name": "session-desktop",
55
"productName": "Session",
66
"description": "Private messaging from your desktop",
7-
"version": "1.17.17",
7+
"version": "1.18.0",
88
"license": "GPL-3.0",
99
"author": {
1010
"name": "Session Foundation",

ts/components/dialog/SessionCTA.tsx

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,18 @@ export const StyledScrollDescriptionContainer = styled.div`
6969
color: var(--text-secondary-color);
7070
`;
7171

72-
const StyledCTAImage = styled.img`
72+
const StyledCTAImage = styled.img<{ $withSmallGradient?: boolean }>`
7373
width: 100%;
7474
height: 100%;
7575
object-fit: cover;
7676
object-position: right center;
7777
background-color: var(--primary-color);
7878
79-
mask-image: linear-gradient(to bottom, black 66%, transparent 97%);
79+
${props =>
80+
props.$withSmallGradient
81+
? 'mask-image: linear-gradient(to bottom, black 90%, transparent 97%);'
82+
: 'mask-image: linear-gradient(to bottom, black 66%, transparent 97%);'}
83+
8084
mask-size: 100% 100%;
8185
`;
8286

@@ -176,7 +180,7 @@ function getImage(variant: CTAVariant): ReactNode {
176180
return <StyledCTAImage src="images/cta/donate.webp" />;
177181

178182
case CTAVariant.DONATE_APPEAL:
179-
return <StyledCTAImage src="images/cta/donate-appeal.webp" />;
183+
return <StyledCTAImage src="images/cta/donate-appeal.webp" $withSmallGradient={true} />;
180184

181185
default:
182186
assertUnreachable(variant, 'getImage');
@@ -186,10 +190,11 @@ function getImage(variant: CTAVariant): ReactNode {
186190

187191
const StyledDonateAppealTitleContainer = styled(Localizer)`
188192
text-align: center;
193+
margin-inline: var(--margins-xs);
189194
`;
190195

191196
function DonateAppealTitle() {
192-
return <StyledDonateAppealTitleContainer token="donateSessionAppealTitle" />;
197+
return <StyledDonateAppealTitleContainer token="finalAppeal" />;
193198
}
194199

195200
function getTitle(variant: CTAVariantExcludingProCTAs) {
@@ -221,7 +226,7 @@ function getDescription(variant: CTAVariantExcludingProCTAs) {
221226
return <Localizer token="donateSessionDescription" />;
222227

223228
case CTAVariant.DONATE_APPEAL:
224-
return <Localizer token="donateSessionAppealDescription" />;
229+
return <Localizer token="finalAppealDescription" />;
225230

226231
default:
227232
assertUnreachable(variant, 'CtaTitle');
@@ -311,7 +316,7 @@ function Buttons({
311316
}}
312317
dataTestId="cta-confirm-button"
313318
>
314-
<Localizer token="donateSessionAppealReadMore" />
319+
<Localizer token="readMoreCapital" />
315320
</SessionButtonShiny>
316321
);
317322
}

ts/node/migration/sessionMigrations.ts

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ import {
4040
} from './utils';
4141
import { CONVERSATION_PRIORITIES } from '../../models/types';
4242
import { MessageDeletedType } from '../../models/messageType';
43+
import { CTAVariant } from '../../components/dialog/cta/types';
4344

4445
// eslint:disable: quotemark one-variable-per-declaration no-unused-expression
4546

@@ -129,6 +130,7 @@ const LOKI_SCHEMA_VERSIONS: Array<(currentVersion: number, db: Database) => void
129130
updateToSessionSchemaVersion52,
130131
updateToSessionSchemaVersion53,
131132
updateToSessionSchemaVersion54,
133+
updateToSessionSchemaVersion55,
132134
];
133135

134136
function updateToSessionSchemaVersion1(currentVersion: number, db: Database) {
@@ -2396,6 +2398,38 @@ async function updateToSessionSchemaVersion54(currentVersion: number, db: Databa
23962398
console.log(`updateToSessionSchemaVersion${targetVersion}: success!`);
23972399
}
23982400

2401+
async function updateToSessionSchemaVersion55(currentVersion: number, db: Database) {
2402+
const targetVersion = 55;
2403+
if (currentVersion >= targetVersion) {
2404+
return;
2405+
}
2406+
console.log(`updateToSessionSchemaVersion${targetVersion}: starting...`);
2407+
2408+
db.transaction(() => {
2409+
const ctaInteractions = sqlNode.getItemById(SettingsKey.ctaInteractions, db)?.value ?? [];
2410+
console.log(
2411+
`updateToSessionSchemaVersion55 ${SettingsKey.ctaInteractions} before: ${JSON.stringify(ctaInteractions)}`
2412+
);
2413+
2414+
const idx = ctaInteractions.findIndex((i: any) => i?.variant === CTAVariant.DONATE_APPEAL);
2415+
if (idx !== -1) {
2416+
ctaInteractions.splice(idx, 1);
2417+
console.log(
2418+
`updateToSessionSchemaVersion55 removed ${CTAVariant.DONATE_APPEAL} from ${SettingsKey.ctaInteractions}`
2419+
);
2420+
sqlNode.createOrUpdateItem({ id: SettingsKey.ctaInteractions, value: ctaInteractions }, db);
2421+
}
2422+
2423+
console.log(
2424+
`updateToSessionSchemaVersion55 ${SettingsKey.ctaInteractions} after: ${JSON.stringify(sqlNode.getItemById(SettingsKey.ctaInteractions, db)?.value ?? [])}`
2425+
);
2426+
2427+
writeSessionSchemaVersion(targetVersion, db);
2428+
})();
2429+
2430+
console.log(`updateToSessionSchemaVersion${targetVersion}: success!`);
2431+
}
2432+
23992433
export function printTableColumns(table: string, db: Database) {
24002434
console.info(db.pragma(`table_info('${table}');`));
24012435
}

ts/state/ducks/networkData.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ const fetchInfoFromSeshServer = createAsyncThunk(
5151
if (infoLoading) {
5252
throw new Error('already loading');
5353
}
54-
5554
payloadCreator.dispatch(setInfoLoading(true));
5655
const result = await NetworkApi.getInfo();
5756
if (!result) {

0 commit comments

Comments
 (0)