mirror of
https://github.com/pybricks/pybricks-code.git
synced 2026-09-12 17:45:22 +00:00
service-worker: rename actions
This adds a prefix to the actions so that we won't have to use aliases.
This commit is contained in:
@@ -34,7 +34,10 @@ import {
|
||||
didFailToConnect as bootloaderDidFailToConnect,
|
||||
} from '../lwp3-bootloader/actions';
|
||||
import { didCompile, didFailToCompile } from '../mpy/actions';
|
||||
import { didSucceed, didUpdate } from '../service-worker/actions';
|
||||
import {
|
||||
serviceWorkerDidSucceed,
|
||||
serviceWorkerDidUpdate,
|
||||
} from '../service-worker/actions';
|
||||
import { add } from './actions';
|
||||
import { MessageId } from './i18n';
|
||||
import notification from './sagas';
|
||||
@@ -60,7 +63,7 @@ test.each([
|
||||
didFailToCompile(['reason']),
|
||||
add('warning', 'message'),
|
||||
add('error', 'message', 'url'),
|
||||
didUpdate({} as ServiceWorkerRegistration),
|
||||
serviceWorkerDidUpdate({} as ServiceWorkerRegistration),
|
||||
didFailToFinish(FailToFinishReasonType.TimedOut),
|
||||
didFailToFinish(
|
||||
FailToFinishReasonType.BleError,
|
||||
@@ -122,7 +125,7 @@ test.each([
|
||||
bleDidFailToConnect({ reason: BleDeviceFailToConnectReasonType.Canceled }),
|
||||
bootloaderDidFailToConnect(BootloaderConnectionFailureReason.Canceled),
|
||||
didFailToFinish(FailToFinishReasonType.FailedToConnect),
|
||||
didSucceed({} as ServiceWorkerRegistration),
|
||||
serviceWorkerDidSucceed({} as ServiceWorkerRegistration),
|
||||
didCheckForUpdate(true),
|
||||
bleDIServiceDidReceiveFirmwareRevision(firmwareVersion),
|
||||
didFailToSaveAs(new DOMException('test message', 'AbortError')),
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
// Copyright (c) 2020 - 2022 The Pybricks Authors
|
||||
// Copyright (c) 2020-2022 The Pybricks Authors
|
||||
|
||||
// Saga for managing notifications (toasts)
|
||||
|
||||
@@ -31,7 +31,7 @@ import {
|
||||
didFailToConnect as bootloaderDidFailToConnect,
|
||||
} from '../lwp3-bootloader/actions';
|
||||
import { didCompile, didFailToCompile } from '../mpy/actions';
|
||||
import { didUpdate as serviceWorkerDidUpdate } from '../service-worker/actions';
|
||||
import { serviceWorkerDidUpdate as serviceWorkerDidUpdate } from '../service-worker/actions';
|
||||
import { pythonVersionToSemver } from '../utils/version';
|
||||
import NotificationAction from './NotificationAction';
|
||||
import NotificationMessage from './NotificationMessage';
|
||||
@@ -363,7 +363,7 @@ function* showServiceWorkerUpdate(
|
||||
|
||||
function* showNoUpdateInfo(action: ReturnType<typeof didCheckForUpdate>): Generator {
|
||||
if (action.updateFound) {
|
||||
// this will be handled by didUpdate action
|
||||
// this will be handled by serviceWorkerDidUpdate action
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user