From c69b2fa053241d6d32073df09c363b1f9d2b7f85 Mon Sep 17 00:00:00 2001 From: Alexis Svinartchouk Date: Fri, 20 Nov 2020 15:29:03 +0100 Subject: [PATCH] Warn when the source drive has no partition table Changelog-entry: Warn when the source drive has no partition table Change-type: patch --- .../app/components/source-selector/source-selector.tsx | 9 +++++++++ lib/shared/messages.ts | 8 ++++++++ 2 files changed, 17 insertions(+) diff --git a/lib/gui/app/components/source-selector/source-selector.tsx b/lib/gui/app/components/source-selector/source-selector.tsx index de877671..6f73c112 100644 --- a/lib/gui/app/components/source-selector/source-selector.tsx +++ b/lib/gui/app/components/source-selector/source-selector.tsx @@ -419,6 +419,15 @@ export class SourceSelector extends React.Component< } } } else { + if (selected.partitionTableType === null) { + analytics.logEvent('Missing partition table', { selected }); + this.setState({ + warning: { + message: messages.warning.driveMissingPartitionTable(), + title: 'Missing partition table', + }, + }); + } metadata = { path: selected.device, displayName: selected.displayName, diff --git a/lib/shared/messages.ts b/lib/shared/messages.ts index 9bdd3372..c0c1e81c 100644 --- a/lib/shared/messages.ts +++ b/lib/shared/messages.ts @@ -117,6 +117,14 @@ export const warning = { ].join(' '); }, + driveMissingPartitionTable: () => { + return outdent({ newline: ' ' })` + It looks like this is not a bootable drive. + The drive does not appear to contain a partition table, + and might not be recognized or bootable by your device. + `; + }, + largeDriveSize: () => { return 'This is a large drive! Make sure it doesn\'t contain files that you want to keep.'; },