Skip to content

Commit

Permalink
some renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
Shane Osbourne committed Nov 26, 2024
1 parent 60a50c9 commit d250d2e
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions special-pages/pages/new-tab/app/service.hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ export function useInitialDataAndConfig({ dispatch, service }) {
const messaging = useMessaging();
useEffect(() => {
if (!service.current) return console.warn('missing service');
const srv = service.current;
const currentService = service.current;
async function init() {
const { config, data } = await srv.getInitial();
const { config, data } = await currentService.getInitial();
if (data) {
dispatch({ kind: 'initial-data', data, config });
} else {
Expand All @@ -110,11 +110,11 @@ export function useInitialDataAndConfig({ dispatch, service }) {
init().catch((e) => {
console.error('uncaught error', e);
dispatch({ kind: 'error', error: e });
messaging.reportPageException({ message: `${srv.name()}: failed to fetch initial data+config: ` + e.message });
messaging.reportPageException({ message: `${currentService.name()}: failed to fetch initial data+config: ` + e.message });
});

return () => {
srv.destroy();
currentService.destroy();
};
}, [messaging]);
}
Expand All @@ -133,9 +133,9 @@ export function useInitialData({ dispatch, service }) {
const messaging = useMessaging();
useEffect(() => {
if (!service.current) return console.warn('missing service');
const srv = service.current;
const currentService = service.current;
async function init() {
const data = await srv.getInitial();
const data = await currentService.getInitial();
if (data) {
dispatch({ kind: 'initial-data', data });
} else {
Expand All @@ -149,11 +149,11 @@ export function useInitialData({ dispatch, service }) {
init().catch((e) => {
console.error('uncaught error', e);
dispatch({ kind: 'error', error: e });
messaging.reportPageException({ message: `${srv.name()}: failed to fetch initial data: ` + e.message });
messaging.reportPageException({ message: `${currentService.name()}: failed to fetch initial data: ` + e.message });
});

return () => {
srv.destroy();
currentService.destroy();
};
}, []);
}
Expand Down

0 comments on commit d250d2e

Please sign in to comment.