一些检查失败了
automerge / automerge (push) Has been cancelled
react-native-android-build-apk / AssembleRelease (push) Has been cancelled
Build macOS M1 / Main (push) Has been cancelled
Joplin Continuous Integration / Main (macos-15-intel) (push) Has been cancelled
Joplin Continuous Integration / Main (ubuntu-22.04) (push) Has been cancelled
Joplin Continuous Integration / Main (ubuntu-22.04-arm) (push) Has been cancelled
Joplin Continuous Integration / Main (windows-11-vs2026-arm) (push) Has been cancelled
Joplin Continuous Integration / Main (windows-2025) (push) Has been cancelled
Joplin Continuous Integration / ServerDockerImage (ubuntu-22.04) (push) Has been cancelled
Joplin Continuous Integration / ServerDockerImage (ubuntu-22.04-arm) (push) Has been cancelled
Joplin UI tests / Main (ubuntu-22.04) (push) Has been cancelled
Joplin UI tests / Main (windows-2025) (push) Has been cancelled
Joplin UI tests / Mobile (push) Has been cancelled
Close stale issues / ProcessStaleIssues (push) Has been cancelled
31 行
981 B
TypeScript
31 行
981 B
TypeScript
import { Dispatch } from 'redux';
|
|
import Resource from '../../../models/Resource';
|
|
import BaseItem from '../../../models/BaseItem';
|
|
import Setting from '../../../models/Setting';
|
|
import Logger from '@joplin/utils/Logger';
|
|
|
|
const logger = Logger.create('checkDisabledSyncItemsNotification');
|
|
|
|
export default async (dispatch: Dispatch) => {
|
|
const errorCount = await Resource.downloadStatusCounts(Resource.FETCH_STATUS_ERROR);
|
|
if (errorCount) {
|
|
logger.info(`${errorCount} resource download errors: Triggering notification`);
|
|
dispatch({ type: 'SYNC_HAS_DISABLED_SYNC_ITEMS' });
|
|
return;
|
|
}
|
|
|
|
const disabledCount = await BaseItem.syncDisabledItemsCount(Setting.value('sync.target'));
|
|
if (disabledCount) {
|
|
logger.info(`${disabledCount} disabled sync items: Triggering notification`);
|
|
dispatch({ type: 'SYNC_HAS_DISABLED_SYNC_ITEMS' });
|
|
return;
|
|
}
|
|
|
|
logger.info('No errors: Hiding notification');
|
|
|
|
dispatch({
|
|
type: 'SYNC_HAS_DISABLED_SYNC_ITEMS',
|
|
value: false,
|
|
});
|
|
};
|