Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。
TypeScript agentai-agentai-assistantandroidclaude-codecodexelectroniosllmmacosreact-nativetypescriptwindows
import { Alert, AppState } from 'react-native';
import i18n from '@/i18n';
let scheduled = false;
/** One notice per app run, deferred until foreground; streaming must not spam alerts. */
export function notifyCacheWriteFailure(): void {
if (scheduled) return;
scheduled = true;
const show = () => Alert.alert(
i18n.t('devices.list.alert.cacheSaveFailed'),
i18n.t('devices.list.alert.cacheSaveFailedDetail'),
);
if (AppState.currentState === 'active') { show(); return; }
const subscription = AppState.addEventListener('change', state => {
if (state !== 'active') return;
subscription.remove();
show();
});
}