|
1 | 1 | import fetch from 'isomorphic-fetch'; |
2 | 2 | import { ThunkAction as ReduxThunkAction, AnyAction } from '@reduxjs/toolkit'; |
3 | | -import { z } from 'zod'; |
4 | 3 |
|
5 | 4 | import { |
6 | 5 | codeSelector, |
@@ -120,18 +119,8 @@ export enum ActionType { |
120 | 119 | NotificationSeen = 'NOTIFICATION_SEEN', |
121 | 120 | BrowserWidthChanged = 'BROWSER_WIDTH_CHANGED', |
122 | 121 | SplitRatioChanged = 'SPLIT_RATIO_CHANGED', |
123 | | - WebSocketError = 'WEBSOCKET_ERROR', |
124 | | - WebSocketConnected = 'WEBSOCKET_CONNECTED', |
125 | | - WebSocketDisconnected = 'WEBSOCKET_DISCONNECTED', |
126 | | - WebSocketFeatureFlagEnabled = 'WEBSOCKET_FEATURE_FLAG_ENABLED', |
127 | 122 | } |
128 | 123 |
|
129 | | -export const WebSocketError = z.object({ |
130 | | - type: z.literal(ActionType.WebSocketError), |
131 | | - error: z.string(), |
132 | | -}); |
133 | | -export type WebSocketError = z.infer<typeof WebSocketError>; |
134 | | - |
135 | 124 | export const initializeApplication = () => createAction(ActionType.InitializeApplication); |
136 | 125 |
|
137 | 126 | export const disableSyncChangesToStorage = () => createAction(ActionType.DisableSyncChangesToStorage); |
@@ -675,11 +664,6 @@ export const browserWidthChanged = (isSmall: boolean) => |
675 | 664 | export const splitRatioChanged = () => |
676 | 665 | createAction(ActionType.SplitRatioChanged); |
677 | 666 |
|
678 | | -export const websocketError = (error: string): WebSocketError => createAction(ActionType.WebSocketError, { error }); |
679 | | -export const websocketConnected = () => createAction(ActionType.WebSocketConnected); |
680 | | -export const websocketDisconnected = () => createAction(ActionType.WebSocketDisconnected); |
681 | | -export const websocketFeatureFlagEnabled = () => createAction(ActionType.WebSocketFeatureFlagEnabled); |
682 | | - |
683 | 667 | function parseChannel(s?: string): Channel | null { |
684 | 668 | switch (s) { |
685 | 669 | case 'stable': |
@@ -821,9 +805,5 @@ export type Action = |
821 | 805 | | ReturnType<typeof notificationSeen> |
822 | 806 | | ReturnType<typeof browserWidthChanged> |
823 | 807 | | ReturnType<typeof splitRatioChanged> |
824 | | - | ReturnType<typeof websocketError> |
825 | | - | ReturnType<typeof websocketConnected> |
826 | | - | ReturnType<typeof websocketDisconnected> |
827 | | - | ReturnType<typeof websocketFeatureFlagEnabled> |
828 | 808 | | ReturnType<typeof wsExecuteRequest> |
829 | 809 | ; |
0 commit comments