ble/alerts: move bluetooth not available from notifications

This commit is contained in:
David Lechner
2022-07-15 13:19:31 -05:00
parent f86a9ad051
commit ef0cd6507d
11 changed files with 43 additions and 13 deletions
-1
View File
@@ -16,7 +16,6 @@ export enum I18nId {
BleUnexpectedError = 'ble.unexpectedError',
BleGattPermission = 'ble.gattPermission',
BleGattServiceNotFound = 'ble.gattServiceNotFound',
BleNoBluetooth = 'ble.noBluetooth',
EditorFailedToOpenFile = 'editor.failedToOpenFile',
EditorFailedToSaveFile = 'editor.failedToSaveFile',
ExplorerFailedToImportFiles = 'explorer.failedToImportFiles',
+4 -4
View File
@@ -61,9 +61,6 @@ function createTestToasterSaga(): { toaster: IToaster; saga: AsyncSaga } {
}
test.each([
bleDidFailToConnectPybricks({
reason: BleDeviceFailToConnectReasonType.NoBluetooth,
}),
bleDidFailToConnectPybricks({ reason: BleDeviceFailToConnectReasonType.NoGatt }),
bleDidFailToConnectPybricks({
reason: BleDeviceFailToConnectReasonType.NoDeviceInfoService,
@@ -78,7 +75,6 @@ test.each([
bootloaderDidFailToConnect(BootloaderConnectionFailureReason.Unknown, <Error>{
message: 'test',
}),
bootloaderDidFailToConnect(BootloaderConnectionFailureReason.NoBluetooth),
bootloaderDidFailToConnect(BootloaderConnectionFailureReason.GattServiceNotFound),
didFailToCompile(['reason']),
add('warning', 'message'),
@@ -134,8 +130,12 @@ test.each([
bleDidFailToConnectPybricks({
reason: BleDeviceFailToConnectReasonType.NoWebBluetooth,
}),
bleDidFailToConnectPybricks({
reason: BleDeviceFailToConnectReasonType.NoBluetooth,
}),
bleDidFailToConnectPybricks({ reason: BleDeviceFailToConnectReasonType.Canceled }),
bootloaderDidFailToConnect(BootloaderConnectionFailureReason.NoWebBluetooth),
bootloaderDidFailToConnect(BootloaderConnectionFailureReason.NoBluetooth),
bootloaderDidFailToConnect(BootloaderConnectionFailureReason.Canceled),
didFailToFinish(FailToFinishReasonType.FailedToConnect),
serviceWorkerDidSucceed(),
-6
View File
@@ -190,9 +190,6 @@ function* showBleDeviceDidFailToConnectError(
hubName: 'Pybricks Hub',
});
break;
case BleDeviceFailToConnectReasonType.NoBluetooth:
yield* showSingleton(Level.Error, I18nId.BleNoBluetooth);
break;
case BleDeviceFailToConnectReasonType.Unknown:
yield* showUnexpectedError(I18nId.BleUnexpectedError, action.err);
break;
@@ -209,9 +206,6 @@ function* showBootloaderDidFailToConnectError(
hubName: 'LEGO Bootloader',
});
break;
case BootloaderConnectionFailureReason.NoBluetooth:
yield* showSingleton(Level.Error, I18nId.BleNoBluetooth);
break;
case BootloaderConnectionFailureReason.Unknown:
yield* showUnexpectedError(I18nId.BleUnexpectedError, action.err);
break;
-1
View File
@@ -5,7 +5,6 @@
"ble": {
"gattPermission": "The web browser did not give permission to use Bluetooth Low Energy",
"gattServiceNotFound": "Connected to hub but failed to get {serviceName} service.\nEnsure that you are using the most recent firmware.\nIf the problem persists, try removing the \"{hubName}\" device in your OS Bluetooth settings, then try connecting again.",
"noBluetooth": "No Bluetooth adapter could be found. Please connect or enable a Bluetooth Low Energy adapter and restart the browser.",
"unexpectedError": "Unexpected error while trying to connect: {errorMessage}"
},
"editor": {