Skip to content

Commit f516b50

Browse files
Checkpoint before follow-up message (#2074)
Co-authored-by: Cursor Agent <[email protected]>
1 parent d0635dc commit f516b50

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

special-pages/pages/history/app/global/Providers/ThemeProvider.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export function ThemeProvider({ children, initialTheme, initialThemeVariant }) {
3030
const [explicitThemeVariant, setExplicitThemeVariant] = useState(/** @type {ThemeVariant | undefined} */ (undefined));
3131

3232
useEffect(() => {
33-
const unsubscribe = history.messaging.subscribe('onThemeUpdate', (data) => {
33+
const unsubscribe = history.onThemeUpdate((data) => {
3434
setExplicitTheme(data.theme);
3535
setExplicitThemeVariant(data.themeVariant);
3636
});

special-pages/pages/history/src/index.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,15 @@ export class HistoryPage {
5454
reportInitException(params) {
5555
this.messaging.notify('reportInitException', params);
5656
}
57+
58+
/**
59+
* Subscribe to theme update notifications from the native layer.
60+
* @param {(data: import('../types/history.ts').OnThemeUpdateSubscribe) => void} callback
61+
* @returns {() => void} Unsubscribe function
62+
*/
63+
onThemeUpdate(callback) {
64+
return this.messaging.subscribe('onThemeUpdate', callback);
65+
}
5766
}
5867

5968
const baseEnvironment = new Environment().withInjectName(import.meta.injectName).withEnv(import.meta.env);

0 commit comments

Comments
 (0)