Move all components from window.api to api #202

This commit is contained in:
Prayag Prajapati committed 2023-10-12 23:49:26 +05:30
1 parent 7e7535edfb
commit 71f3cb6325
22 files changed
+316 -269

No files matched your search

+4 -2
View File
@@ -4,7 +4,7 @@ import React, { useState, useEffect } from "react";
import { useNavigate } from "react-router-dom";
import { EventEmitter as event } from "../../../eventEmitter.js";
import { setServer } from "../../../utils/storage/servers.js";
import { setDefaultServer, setServer } from "../../../utils/storage/servers.js";
import { getSystemApi } from "@jellyfin/sdk/lib/utils/api/system-api";
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
@@ -161,10 +161,12 @@ export const ServerSetup = () => {
onSuccess: (bestServer) => {
if (bestServer) {
console.info(bestServer);
createApi(bestServer.address, null);
setDefaultServer(bestServer.systemInfo.Id);
setServer(bestServer.systemInfo.Id, bestServer);
enqueueSnackbar("Client added successfully", {
variant: "success",
});
createApi(bestServer.address, null);
navigate("/login");
}
},