Skip to content

Commit

Permalink
Fix lint:ci problems
Browse files Browse the repository at this point in the history
  • Loading branch information
aneuwald-ctw committed Apr 15, 2024
1 parent 97698d5 commit 0e0de1b
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,14 @@ export function useUnsavedChangesPrompt(): {
const [isOnline, setIsOnline] = useState(layoutManager.isOnline);

useLayoutEffect(() => {
const onlineListener = () => { setIsOnline(layoutManager.isOnline); };
const onlineListener = () => {
setIsOnline(layoutManager.isOnline);
};
onlineListener();
layoutManager.on("onlinechange", onlineListener);
return () => { layoutManager.off("onlinechange", onlineListener); };
return () => {
layoutManager.off("onlinechange", onlineListener);
};
}, [layoutManager]);

const unsavedChangesPrompt = useMemo(() => {
Expand Down
21 changes: 17 additions & 4 deletions packages/studio-base/src/hooks/usePrompt.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,20 @@ function ModalPrompt({
// Ensure we still call onComplete(undefined) when the component unmounts, if it hasn't been
// called already
useEffect(() => {
return () => { onComplete(undefined); };
return () => {
onComplete(undefined);
};
}, [onComplete]);

return (
<Dialog open maxWidth="xs" fullWidth onClose={() => { onComplete(undefined); }}>
<Dialog
open
maxWidth="xs"
fullWidth
onClose={() => {
onComplete(undefined);
}}
>
<form onSubmit={onSubmitAction}>
<Stack paddingX={3} paddingTop={2}>
<Typography variant="h4" fontWeight={600} gutterBottom>
Expand All @@ -105,15 +114,19 @@ function ModalPrompt({
FormHelperTextProps={{
variant: "standard",
}}
onChange={(event) => { setValue(event.target.value); }}
onChange={(event) => {
setValue(event.target.value);
}}
/>
</DialogContent>
<DialogActions>
<Button
color="inherit"
size="large"
variant="outlined"
onClick={() => { onComplete(undefined); }}
onClick={() => {
onComplete(undefined);
}}
>
Cancel
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ export class NamespacedLayoutStorage {
) {
this.#migration = (async function () {
if (migrateUnnamespacedLayouts) {
await storage
.migrateUnnamespacedLayouts?.(namespace)
.catch((error) => { log.error("Migration failed:", error); });
await storage.migrateUnnamespacedLayouts?.(namespace).catch((error) => {
log.error("Migration failed:", error);
});
}

if (importFromNamespace != undefined) {
Expand All @@ -34,7 +34,9 @@ export class NamespacedLayoutStorage {
fromNamespace: importFromNamespace,
toNamespace: namespace,
})
.catch((error) => { log.error("Import failed:", error); });
.catch((error) => {
log.error("Import failed:", error);
});
}
})();
}
Expand Down

0 comments on commit 0e0de1b

Please sign in to comment.