Skip to content

Commit

Permalink
rename actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander-Kezik authored and IlyaBondar committed Feb 12, 2024
1 parent 9733bfb commit cfbd9fd
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,8 @@ export const MigrationFailedWindow = ({
}),
);

dispatch(ConversationsActions.migrateConversations());
dispatch(PromptsActions.migratePrompts());
dispatch(ConversationsActions.migrateConversationsIfRequired());
dispatch(PromptsActions.migratePromptsIfRequired());
}, [
conversationsToRetryIds,
dispatch,
Expand Down
6 changes: 3 additions & 3 deletions apps/chat/src/store/conversations/conversations.epics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -705,11 +705,11 @@ const deleteConversationsEpic: AppEpic = (action$, state$) =>
}),
);

const migrateConversationsEpic: AppEpic = (action$, state$) => {
const migrateConversationsIfRequiredEpic: AppEpic = (action$, state$) => {
const browserStorage = new BrowserStorage();

return action$.pipe(
filter(ConversationsActions.migrateConversations.match),
filter(ConversationsActions.migrateConversationsIfRequired.match),
switchMap(() =>
forkJoin({
conversations: browserStorage
Expand Down Expand Up @@ -2239,7 +2239,7 @@ const openFolderEpic: AppEpic = (action$, state$) =>
);

export const ConversationsEpics = combineEpics(
migrateConversationsEpic,
migrateConversationsIfRequiredEpic,
skipFailedMigratedConversationsEpic,
// init
initEpic,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export const conversationsSlice = createSlice({
initialState,
reducers: {
init: (state) => state,
migrateConversations: (state) => state,
migrateConversationsIfRequired: (state) => state,
initConversationsMigration: (
state,
{
Expand Down
6 changes: 3 additions & 3 deletions apps/chat/src/store/prompts/prompts.epics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -402,11 +402,11 @@ const importPromptsEpic: AppEpic = (action$, state$) =>
// ),
// );

const migratePromptsEpic: AppEpic = (action$, state$) => {
const migratePromptsIfRequiredEpic: AppEpic = (action$, state$) => {
const browserStorage = new BrowserStorage();

return action$.pipe(
filter(PromptsActions.migratePrompts.match),
filter(PromptsActions.migratePromptsIfRequired.match),
switchMap(() =>
forkJoin({
prompts: browserStorage.getPrompts().pipe(map(filterOnlyMyEntities)),
Expand Down Expand Up @@ -838,7 +838,7 @@ export const uploadPromptEpic: AppEpic = (action$, state$) =>
);

export const PromptsEpics = combineEpics(
migratePromptsEpic,
migratePromptsIfRequiredEpic,
skipFailedMigratedPromptsEpic,
// init
initEpic,
Expand Down
2 changes: 1 addition & 1 deletion apps/chat/src/store/prompts/prompts.reducers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export const promptsSlice = createSlice({
reducers: {
init: (state) => state,
initPrompts: (state) => state,
migratePrompts: (state) => state,
migratePromptsIfRequired: (state) => state,
skipFailedMigratedPrompts: (
state,
{ payload: _ }: PayloadAction<{ idsToMarkAsMigrated: string[] }>,
Expand Down
4 changes: 2 additions & 2 deletions apps/chat/src/store/settings/settings.epic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ const initEpic: AppEpic = (action$, state$) =>
),
switchMap(() =>
concat(
of(ConversationsActions.migrateConversations()),
of(PromptsActions.migratePrompts()),
of(ConversationsActions.migrateConversationsIfRequired()),
of(PromptsActions.migratePromptsIfRequired()),
of(UIActions.init()),
of(ModelsActions.init()),
of(AddonsActions.init()),
Expand Down

0 comments on commit cfbd9fd

Please sign in to comment.