Skip to content

Commit

Permalink
fix: added special '500' case to the polling interval handling
Browse files Browse the repository at this point in the history
  • Loading branch information
zovomat committed Mar 14, 2022
1 parent 9d6e8bf commit e283a78
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/network/get-info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ import { isAdmin, isFullClient, isStandalone } from '../multimode';

const parsePollingInterval = (settings: AccountSettings): number => {
const pollingPref = (settings.prefs?.zimbraPrefMailPollingInterval ?? '') as string;
if (pollingPref === '500') {
return 500;
}
const pollingValue = parseInt(pollingPref, 10);
if (Number.isNaN(pollingValue)) {
return 30000;
Expand Down
7 changes: 6 additions & 1 deletion src/network/noOp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,10 @@ import { AccountState } from '../../types';
import { SHELL_APP_ID } from '../constants';

export const noOp = (get: GetState<AccountState>): void => {
get().soapFetch(SHELL_APP_ID)('NoOp', { _jsns: 'urn:zimbraMail' });
get().soapFetch(SHELL_APP_ID)(
'NoOp',
get().pollingInterval === 500
? { _jsns: 'urn:zimbraMail', limitToOneBlocked: 1, wait: 1 }
: { _jsns: 'urn:zimbraMail' }
);
};

0 comments on commit e283a78

Please sign in to comment.