diff --git a/packages/pl-fe/src/actions/sw.ts b/packages/pl-fe/src/actions/sw.ts deleted file mode 100644 index 346864bda..000000000 --- a/packages/pl-fe/src/actions/sw.ts +++ /dev/null @@ -1,16 +0,0 @@ -/** Sets the ServiceWorker updating state. */ -const SW_UPDATING = 'SW_UPDATING' as const; - -/** Dispatch when the ServiceWorker is being updated to display a loading screen. */ -const setSwUpdating = (isUpdating: boolean) => ({ - type: SW_UPDATING, - isUpdating, -}); - -type SwAction = ReturnType; - -export { - SW_UPDATING, - setSwUpdating, - type SwAction, -}; diff --git a/packages/pl-fe/src/reducers/meta.test.ts b/packages/pl-fe/src/reducers/meta.test.ts index ea1bd08b9..93ddc40ee 100644 --- a/packages/pl-fe/src/reducers/meta.test.ts +++ b/packages/pl-fe/src/reducers/meta.test.ts @@ -1,7 +1,5 @@ import { Record as ImmutableRecord } from 'immutable'; -import { SW_UPDATING, setSwUpdating } from 'pl-fe/actions/sw'; - import reducer from './meta'; describe('meta reducer', () => { @@ -11,11 +9,4 @@ describe('meta reducer', () => { expect(result.instance_fetch_failed).toBe(false); expect(result.swUpdating).toBe(false); }); - - describe(SW_UPDATING, () => { - it('sets swUpdating to the provided value', () => { - const result = reducer(undefined, setSwUpdating(true)); - expect(result.swUpdating).toBe(true); - }); - }); }); diff --git a/packages/pl-fe/src/reducers/meta.ts b/packages/pl-fe/src/reducers/meta.ts index c3493fdfb..5c7238c4a 100644 --- a/packages/pl-fe/src/reducers/meta.ts +++ b/packages/pl-fe/src/reducers/meta.ts @@ -1,24 +1,19 @@ import { Record as ImmutableRecord } from 'immutable'; import { INSTANCE_FETCH_FAIL, type InstanceAction } from 'pl-fe/actions/instance'; -import { SW_UPDATING, type SwAction } from 'pl-fe/actions/sw'; const ReducerRecord = ImmutableRecord({ /** Whether /api/v1/instance 404'd (and we should display the external auth form). */ instance_fetch_failed: false, - /** Whether the ServiceWorker is currently updating (and we should display a loading screen). */ - swUpdating: false, }); -const meta = (state = ReducerRecord(), action: InstanceAction | SwAction) => { +const meta = (state = ReducerRecord(), action: InstanceAction) => { switch (action.type) { case INSTANCE_FETCH_FAIL: if (action.error?.response?.status === 404) { return state.set('instance_fetch_failed', true); } return state; - case SW_UPDATING: - return state.set('swUpdating', action.isUpdating); default: return state; }