MCPcopy
hub / github.com/gitify-app/gitify / AppProvider

Function AppProvider

src/renderer/context/App.tsx:128–667  ·  view source on GitHub ↗
({ children }: { children: ReactNode })

Source from the content-addressed store, hash-verified

126);
127
128export const AppProvider = ({ children }: { children: ReactNode }) => {
129 const existingState = loadState();
130
131 const [auth, setAuth] = useState<AuthState>(
132 existingState.auth
133 ? { ...defaultAuth, ...existingState.auth }
134 : defaultAuth,
135 );
136
137 const [settings, setSettings] = useState<SettingsState>(
138 existingState.settings
139 ? { ...defaultSettings, ...existingState.settings }
140 : defaultSettings,
141 );
142
143 const lastAppliedOpenGitifyShortcutRef = useRef(settings.openGitifyShortcut);
144 const [shortcutRegistrationError, setShortcutRegistrationError] = useState<
145 string | null
146 >(null);
147
148 const clearShortcutRegistrationError = useCallback(() => {
149 setShortcutRegistrationError(null);
150 }, []);
151
152 const { setColorMode, setDayScheme, setNightScheme } = useTheme();
153
154 const {
155 status,
156 globalError,
157
158 notifications,
159 notificationCount,
160 unreadNotificationCount,
161 hasNotifications,
162 hasUnreadNotifications,
163
164 fetchNotifications,
165 removeAccountNotifications,
166
167 markNotificationsAsRead,
168 markNotificationsAsDone,
169 unsubscribeNotification,
170 } = useNotifications();
171
172 const includeSearchTokens = useFiltersStore((s) => s.includeSearchTokens);
173 const excludeSearchTokens = useFiltersStore((s) => s.excludeSearchTokens);
174 const userTypes = useFiltersStore((s) => s.userTypes);
175 const subjectTypes = useFiltersStore((s) => s.subjectTypes);
176 const states = useFiltersStore((s) => s.states);
177 const reasons = useFiltersStore((s) => s.reasons);
178
179 const persistAuth = useCallback(
180 (nextAuth: AuthState) => {
181 setAuth(nextAuth);
182 saveState({ auth: nextAuth, settings });
183 },
184 [settings],
185 );

Callers

nothing calls this directly

Calls 15

loadStateFunction · 0.90
useNotificationsFunction · 0.90
saveStateFunction · 0.90
refreshAccountFunction · 0.90
decryptValueFunction · 0.90
encryptValueFunction · 0.90
getAccountUUIDFunction · 0.90
useIntervalTimerFunction · 0.90
useInactivityTimerFunction · 0.90
mapThemeModeToColorModeFunction · 0.90
setUseUnreadActiveIconFunction · 0.90

Tested by

no test coverage detected