Skip to content

Commit

Permalink
Revert "chore: add applets refresh after answers submission (#884)"
Browse files Browse the repository at this point in the history
This reverts commit 34b9471.
  • Loading branch information
farmerpaul committed Oct 31, 2024
1 parent 34b9471 commit e091804
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 15 deletions.
5 changes: 1 addition & 4 deletions src/entities/activity/lib/hooks/useQueueProcessing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { useForceUpdate } from '@app/shared/lib/hooks/useForceUpdate';
import { getDefaultChangeQueueObservable } from '@app/shared/lib/observables/changeQueueObservableInstance';
import { getDefaultUploadObservable } from '@app/shared/lib/observables/uploadObservableInstance';
import { getDefaultLogger } from '@app/shared/lib/services/loggerInstance';
import { useRefreshMutation } from '@entities/applet/model/hooks/useRefreshMutation.ts';

import { getDefaultAnswersQueueService } from '../services/answersQueueServiceInstance';
import { getDefaultQueueProcessingService } from '../services/queueProcessingServiceInstance';
Expand All @@ -22,7 +21,6 @@ type Result = {

export const useQueueProcessing = (): Result => {
const update = useForceUpdate();
const { mutateAsync: refreshApplets } = useRefreshMutation();

useEffect(() => {
const onChangeUploadState = () => {
Expand All @@ -48,8 +46,7 @@ export const useQueueProcessing = (): Result => {

const processQueueWithSendingLogs = async (): Promise<boolean> => {
const result = await queueProcessingService.process();
await refreshApplets();
getDefaultLogger().send().catch(console.error);
getDefaultLogger().send();

Check warning on line 49 in src/entities/activity/lib/hooks/useQueueProcessing.ts

View workflow job for this annotation

GitHub Actions / ESLint

src/entities/activity/lib/hooks/useQueueProcessing.ts#L49

Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator (@typescript-eslint/no-floating-promises)
return result;
};

Expand Down
12 changes: 1 addition & 11 deletions src/widgets/survey/model/hooks/useAutoCompletion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import { ReduxPersistor } from '@app/shared/lib/redux-state/store';
import { Emitter } from '@app/shared/lib/services/Emitter';
import { getDefaultLogger } from '@app/shared/lib/services/loggerInstance';
import { getMutexDefaultInstanceManager } from '@app/shared/lib/utils/mutexDefaultInstanceManagerInstance';
import { useRefreshMutation } from '@entities/applet/model/hooks/useRefreshMutation.ts';
import { CollectCompletionOutput } from '@widgets/survey/model/services/ICollectCompletionsService';

import { CollectCompletionsService } from '../services/CollectCompletionsService';
Expand All @@ -49,8 +48,6 @@ export const useAutoCompletion = (): Result => {

const queryClient = useQueryClient();

const { mutateAsync: refreshApplets } = useRefreshMutation();

const hasItemsInQueue = useCallback(() => {
return getDefaultAnswersQueueService().getLength() > 0;
}, []);
Expand Down Expand Up @@ -183,7 +180,6 @@ export const useAutoCompletion = (): Result => {

if (hasItemsInQueue()) {
result = await getDefaultQueueProcessingService().process();
await refreshApplets();
}

if (forceRefreshNotifications || completionsCollected) {
Expand All @@ -192,13 +188,7 @@ export const useAutoCompletion = (): Result => {

return result;
},
[
mutex,
incompletedEntities,
createConstructService,
hasItemsInQueue,
refreshApplets,
],
[mutex, incompletedEntities, createConstructService, hasItemsInQueue],
);

const hasExpiredEntity = useCallback((): boolean => {
Expand Down

0 comments on commit e091804

Please sign in to comment.