diff --git a/playwright/snapshots/crypto/toasts.spec.ts/key-storage-out-of-sync-toast-linux.png b/playwright/snapshots/crypto/toasts.spec.ts/key-storage-out-of-sync-toast-linux.png index 8e335bd2323..8cf3cb7d698 100644 Binary files a/playwright/snapshots/crypto/toasts.spec.ts/key-storage-out-of-sync-toast-linux.png and b/playwright/snapshots/crypto/toasts.spec.ts/key-storage-out-of-sync-toast-linux.png differ diff --git a/src/toasts/SetupEncryptionToast.ts b/src/toasts/SetupEncryptionToast.ts index 2545aa6ff23..8a743dfe8b4 100644 --- a/src/toasts/SetupEncryptionToast.ts +++ b/src/toasts/SetupEncryptionToast.ts @@ -6,6 +6,10 @@ SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Com Please see LICENSE files in the repository root for full details. */ +import KeyIcon from "@vector-im/compound-design-tokens/assets/web/icons/key"; +import { type ComponentType } from "react"; + +import type React from "react"; import Modal from "../Modal"; import { _t } from "../languageHandler"; import DeviceListener from "../DeviceListener"; @@ -61,6 +65,19 @@ const getSetupCaption = (kind: Kind): string => { } }; +/** + * Get the icon to show on the primary button. + * @param kind + */ +const getPrimaryButtonIcon = (kind: Kind): ComponentType> | undefined => { + switch (kind) { + case Kind.KEY_STORAGE_OUT_OF_SYNC: + return KeyIcon; + default: + return; + } +}; + const getSecondaryButtonLabel = (kind: Kind): string => { switch (kind) { case Kind.SET_UP_RECOVERY: @@ -162,6 +179,7 @@ export const showToast = (kind: Kind): void => { props: { description: getDescription(kind), primaryLabel: getSetupCaption(kind), + PrimaryIcon: getPrimaryButtonIcon(kind), onPrimaryClick, secondaryLabel: getSecondaryButtonLabel(kind), onSecondaryClick,