Skip to content

Commit 952bee2

Browse files
committed
Fix prettier complaints
1 parent a669272 commit 952bee2

File tree

3 files changed

+31
-26
lines changed

3 files changed

+31
-26
lines changed

client/src/App.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,9 @@ const App = () => {
128128
const [selectedResource, setSelectedResource] = useState<Resource | null>(
129129
null,
130130
);
131-
const [resourceSubscriptions, setResourceSubscriptions] = useState<Set<string>>(new Set<string>());
131+
const [resourceSubscriptions, setResourceSubscriptions] = useState<
132+
Set<string>
133+
>(new Set<string>());
132134

133135
const [selectedPrompt, setSelectedPrompt] = useState<Prompt | null>(null);
134136
const [selectedTool, setSelectedTool] = useState<Tool | null>(null);
@@ -311,7 +313,6 @@ const App = () => {
311313
};
312314

313315
const subscribeToResource = async (uri: string) => {
314-
315316
if (!resourceSubscriptions.has(uri)) {
316317
await makeRequest(
317318
{
@@ -325,11 +326,9 @@ const App = () => {
325326
clone.add(uri);
326327
setResourceSubscriptions(clone);
327328
}
328-
329329
};
330330

331331
const unsubscribeFromResource = async (uri: string) => {
332-
333332
if (resourceSubscriptions.has(uri)) {
334333
await makeRequest(
335334
{
@@ -345,7 +344,6 @@ const App = () => {
345344
}
346345
};
347346

348-
349347
const listPrompts = async () => {
350348
const response = await makeRequest(
351349
{
@@ -523,7 +521,9 @@ const App = () => {
523521
clearError("resources");
524522
setSelectedResource(resource);
525523
}}
526-
resourceSubscriptionsSupported={serverCapabilities?.resources?.subscribe || false}
524+
resourceSubscriptionsSupported={
525+
serverCapabilities?.resources?.subscribe || false
526+
}
527527
resourceSubscriptions={resourceSubscriptions}
528528
subscribeToResource={(uri) => {
529529
clearError("resources");

client/src/components/ResourcesTab.tsx

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -173,23 +173,28 @@ const ResourcesTab = ({
173173
</h3>
174174
{selectedResource && (
175175
<div className="flex row-auto gap-1 justify-end w-2/5">
176-
{ resourceSubscriptionsSupported && !resourceSubscriptions.has(selectedResource.uri) && <Button
177-
variant="outline"
178-
size="sm"
179-
onClick={() => subscribeToResource(selectedResource.uri)}
180-
>
181-
Subscribe
182-
</Button>
183-
}
184-
{ resourceSubscriptionsSupported && resourceSubscriptions.has(selectedResource.uri) &&
185-
<Button
186-
variant="outline"
187-
size="sm"
188-
onClick={() => unsubscribeFromResource(selectedResource.uri)}
189-
>
190-
Unsubscribe
191-
</Button>
192-
}
176+
{resourceSubscriptionsSupported &&
177+
!resourceSubscriptions.has(selectedResource.uri) && (
178+
<Button
179+
variant="outline"
180+
size="sm"
181+
onClick={() => subscribeToResource(selectedResource.uri)}
182+
>
183+
Subscribe
184+
</Button>
185+
)}
186+
{resourceSubscriptionsSupported &&
187+
resourceSubscriptions.has(selectedResource.uri) && (
188+
<Button
189+
variant="outline"
190+
size="sm"
191+
onClick={() =>
192+
unsubscribeFromResource(selectedResource.uri)
193+
}
194+
>
195+
Unsubscribe
196+
</Button>
197+
)}
193198
<Button
194199
variant="outline"
195200
size="sm"

client/src/lib/notificationTypes.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ export const StdErrNotificationSchema = BaseNotificationSchema.extend({
1212
}),
1313
});
1414

15-
export const NotificationSchema = ClientNotificationSchema
16-
.or(StdErrNotificationSchema)
17-
.or(ServerNotificationSchema);
15+
export const NotificationSchema = ClientNotificationSchema.or(
16+
StdErrNotificationSchema,
17+
).or(ServerNotificationSchema);
1818

1919
export type StdErrNotification = z.infer<typeof StdErrNotificationSchema>;
2020
export type Notification = z.infer<typeof NotificationSchema>;

0 commit comments

Comments
 (0)