Compare commits
15 Commits
Author | SHA1 | Date | |
---|---|---|---|
f31126e2b1 | |||
d171545f18 | |||
b6b48da5fa | |||
6551f0b369 | |||
f046746037 | |||
74e233ecc3 | |||
a848f078be | |||
9f71ad0f8e | |||
45c5b329b5 | |||
b0f180f1fb | |||
6d42b4fe89 | |||
b8f45ad0b8 | |||
cd8f42327c | |||
6881a0d1d5 | |||
9f9804f161 |
|
@ -1,4 +1,4 @@
|
|||
const appName = "EZPPLauncher";
|
||||
const appVersion = "2.1.6";
|
||||
const appVersion = "2.1.7";
|
||||
|
||||
module.exports = { appName, appVersion };
|
||||
|
|
|
@ -16,17 +16,25 @@ const platforms = {
|
|||
};
|
||||
const crypto = require("crypto");
|
||||
|
||||
const defaultHWID = "recorderinthesandybridge";
|
||||
|
||||
/**
|
||||
* Returns machine hardware id.
|
||||
* Returns `undefined` if cannot determine.
|
||||
* @return {string?}
|
||||
* @return {Promise<string>}
|
||||
*/
|
||||
function getHwId() {
|
||||
const getter = platforms[process.platform];
|
||||
if (!getter) return;
|
||||
const result = getter[1].exec(child_process.execSync(getter[0], options));
|
||||
if (!result) return;
|
||||
return crypto.createHash("md5").update(result[1]).digest("hex") ||
|
||||
undefined;
|
||||
return new Promise((resolve) => {
|
||||
try {
|
||||
const getter = platforms[process.platform];
|
||||
if (getter) {
|
||||
const result = getter[1].exec(child_process.execSync(getter[0], options));
|
||||
if (result) resolve(crypto.createHash("md5").update(result[1]).digest("hex"));
|
||||
}
|
||||
resolve(crypto.createHash("md5").update(defaultHWID).digest("hex"));
|
||||
} catch {
|
||||
resolve(crypto.createHash("md5").update(defaultHWID).digest("hex"));
|
||||
}
|
||||
})
|
||||
}
|
||||
exports.getHwId = getHwId;
|
||||
|
|
|
@ -1,6 +1,12 @@
|
|||
async function checkImageExists(url) {
|
||||
try {
|
||||
const response = await fetch(url, { method: "HEAD" });
|
||||
const response = await fetch(url, {
|
||||
method: "HEAD",
|
||||
headers: {
|
||||
"User-Agent":
|
||||
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36 Edg/128.0.0.0",
|
||||
},
|
||||
});
|
||||
if (!response.ok) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -152,7 +152,12 @@ function getUserConfig(osuPath) {
|
|||
}
|
||||
|
||||
async function getUpdateFiles(releaseStream) {
|
||||
const releaseData = await fetch(checkUpdateURL + releaseStream);
|
||||
const releaseData = await fetch(checkUpdateURL + releaseStream, {
|
||||
headers: {
|
||||
"User-Agent":
|
||||
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36 Edg/128.0.0.0",
|
||||
},
|
||||
});
|
||||
return releaseData.ok ? await releaseData.json() : undefined;
|
||||
}
|
||||
|
||||
|
@ -244,6 +249,10 @@ async function getEZPPLauncherUpdateFiles(osuPath) {
|
|||
const filesToDownload = [];
|
||||
const updateFilesRequest = await fetch(ezppLauncherUpdateList, {
|
||||
method: "PATCH",
|
||||
headers: {
|
||||
"User-Agent":
|
||||
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36 Edg/128.0.0.0",
|
||||
},
|
||||
});
|
||||
const updateFiles = await updateFilesRequest.json();
|
||||
for (const updateFile of updateFiles) {
|
||||
|
@ -264,24 +273,44 @@ async function getEZPPLauncherUpdateFiles(osuPath) {
|
|||
filesToDownload.push(updateFile);
|
||||
}
|
||||
}
|
||||
return filesToDownload;
|
||||
return [filesToDownload, updateFiles];
|
||||
}
|
||||
|
||||
async function downloadEZPPLauncherUpdateFiles(osuPath, updateFiles) {
|
||||
async function downloadEZPPLauncherUpdateFiles(osuPath, updateFiles, allFiles) {
|
||||
const eventEmitter = new EventEmitter();
|
||||
|
||||
const startDownload = async () => {
|
||||
//NOTE: delete files that are not in the updateFiles array
|
||||
const foldersToPrune = updateFiles.map(file => path.dirname(path.join(osuPath, ...file.folder.split("/"), file.name))).filter((folder, index, self) => self.indexOf(folder) === index);
|
||||
const foldersToPrune = allFiles.map((file) =>
|
||||
path.dirname(path.join(osuPath, ...file.folder.split("/"), file.name))
|
||||
).filter((folder, index, self) => self.indexOf(folder) === index);
|
||||
for (const pruneFolder of foldersToPrune) {
|
||||
//NOTE: check if the folder is not the osu root folder.
|
||||
if (path.basename(pruneFolder) == "osu!")
|
||||
if (path.basename(pruneFolder) == "osu!") {
|
||||
continue;
|
||||
for (const files of await fs.promises.readdir(pruneFolder)) {
|
||||
const filePath = path.join(pruneFolder, files);
|
||||
if (!updateFiles.some(file => path.join(osuPath, ...file.folder.split("/"), file.name) === filePath)) {
|
||||
|
||||
await fs.promises.rm(filePath, { recursive: true, force: true });
|
||||
}
|
||||
if (fs.existsSync(pruneFolder)) {
|
||||
for (const files of await fs.promises.readdir(pruneFolder)) {
|
||||
const filePath = path.join(pruneFolder, files);
|
||||
const validFolder = allFiles.find((file) =>
|
||||
path.dirname(filePath).endsWith(file.folder)
|
||||
);
|
||||
if (!validFolder) {
|
||||
if (
|
||||
allFiles.find((file) => file.name == path.basename(filePath)) ===
|
||||
undefined
|
||||
) {
|
||||
eventEmitter.emit("data", {
|
||||
fileName: path.basename(filePath),
|
||||
});
|
||||
try {
|
||||
await fs.promises.rm(filePath, {
|
||||
recursive: true,
|
||||
force: true,
|
||||
});
|
||||
} catch {}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,7 +10,12 @@ const releasesUrl =
|
|||
module.exports = {
|
||||
updateAvailable: async () => {
|
||||
try {
|
||||
const latestRelease = await fetch(repoApiUrl);
|
||||
const latestRelease = await fetch(repoApiUrl, {
|
||||
headers: {
|
||||
"User-Agent":
|
||||
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36 Edg/128.0.0.0",
|
||||
},
|
||||
});
|
||||
const json = await latestRelease.json();
|
||||
if (json.length <= 0) return false;
|
||||
return {
|
||||
|
|
70
main.js
70
main.js
|
@ -76,6 +76,12 @@ function startOsuStatus() {
|
|||
try {
|
||||
const currentUserInfo = await fetch(
|
||||
`https://api.ez-pp.farm/get_player_info?name=${currentUser.username}&scope=info`,
|
||||
{
|
||||
headers: {
|
||||
"User-Agent":
|
||||
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36 Edg/128.0.0.0",
|
||||
},
|
||||
},
|
||||
);
|
||||
const currentUserInfoJson = await currentUserInfo.json();
|
||||
if (
|
||||
|
@ -116,7 +122,14 @@ function startOsuStatus() {
|
|||
const windowTitle = firstInstance.processTitle;
|
||||
lastOsuStatus = windowTitle;
|
||||
const currentStatusRequest = await fetch(
|
||||
"https://api.ez-pp.farm/v1/get_player_status?name=" + currentUser.username,
|
||||
"https://api.ez-pp.farm/v1/get_player_status?name=" +
|
||||
currentUser.username,
|
||||
{
|
||||
headers: {
|
||||
"User-Agent":
|
||||
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36 Edg/128.0.0.0",
|
||||
},
|
||||
},
|
||||
);
|
||||
const currentStatus = await currentStatusRequest.json();
|
||||
|
||||
|
@ -127,7 +140,14 @@ function startOsuStatus() {
|
|||
const currentModeString = gamemodes[currentMode];
|
||||
|
||||
const currentInfoRequest = await fetch(
|
||||
"https://api.ez-pp.farm/v1/get_player_info?name=" + currentUser.username + "&scope=all",
|
||||
"https://api.ez-pp.farm/v1/get_player_info?name=" +
|
||||
currentUser.username + "&scope=all",
|
||||
{
|
||||
headers: {
|
||||
"User-Agent":
|
||||
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36 Edg/128.0.0.0",
|
||||
},
|
||||
},
|
||||
);
|
||||
const currentInfo = await currentInfoRequest.json();
|
||||
let currentUsername = currentInfo.player.info.name;
|
||||
|
@ -228,7 +248,7 @@ function registerIPCPipes() {
|
|||
ipcMain.handle("ezpplauncher:login", async (e, args) => {
|
||||
let hwid = "";
|
||||
try {
|
||||
hwid = getHwId();
|
||||
hwid = await getHwId();
|
||||
} catch (err) {
|
||||
logger.error(`Failed to get HWID.`, err);
|
||||
return {
|
||||
|
@ -237,7 +257,7 @@ function registerIPCPipes() {
|
|||
};
|
||||
}
|
||||
const timeout = new AbortController();
|
||||
const timeoutId = setTimeout(() => timeout.abort(), 8000);
|
||||
const timeoutId = setTimeout(() => timeout.abort(), 1000 * 10);
|
||||
logger.log(`Logging in with user ${args.username}...`);
|
||||
try {
|
||||
const fetchResult = await fetch("https://ez-pp.farm/login/check", {
|
||||
|
@ -249,6 +269,8 @@ function registerIPCPipes() {
|
|||
}),
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
"User-Agent":
|
||||
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36 Edg/128.0.0.0",
|
||||
},
|
||||
});
|
||||
|
||||
|
@ -268,7 +290,7 @@ function registerIPCPipes() {
|
|||
return result;
|
||||
}
|
||||
logger.log(
|
||||
`Login failed for user ${username}.\nResponse:\n${await fetchResult
|
||||
`Login failed for user ${args.username}.\nResponse:\n${await fetchResult
|
||||
.text()}`,
|
||||
);
|
||||
return {
|
||||
|
@ -293,7 +315,7 @@ function registerIPCPipes() {
|
|||
});
|
||||
|
||||
ipcMain.handle("ezpplauncher:autologin", async (e) => {
|
||||
const hwid = getHwId();
|
||||
const hwid = await getHwId();
|
||||
const username = config.get("username");
|
||||
const guest = config.get("guest");
|
||||
if (guest) return { code: 200, message: "Login as guest", guest: true };
|
||||
|
@ -317,6 +339,8 @@ function registerIPCPipes() {
|
|||
}),
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
"User-Agent":
|
||||
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36 Edg/128.0.0.0",
|
||||
},
|
||||
});
|
||||
|
||||
|
@ -384,7 +408,7 @@ function registerIPCPipes() {
|
|||
}
|
||||
|
||||
if (key == "logging") {
|
||||
logger.enabled = logging;
|
||||
logger.enabled = value;
|
||||
}
|
||||
|
||||
if (typeof value == "boolean") {
|
||||
|
@ -432,8 +456,9 @@ function registerIPCPipes() {
|
|||
|
||||
ipcMain.handle("ezpplauncher:checkUpdate", async (e) => {
|
||||
const updateInfo = await updateAvailable();
|
||||
if (updateInfo.update)
|
||||
if (updateInfo.update) {
|
||||
mainWindow.webContents.send("ezpplauncher:update", updateInfo.release);
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.handle("ezpplauncher:exitAndUpdate", async (e) => {
|
||||
|
@ -529,8 +554,9 @@ function registerIPCPipes() {
|
|||
progress: Math.ceil(data.progress),
|
||||
});
|
||||
mainWindow.webContents.send("ezpplauncher:launchstatus", {
|
||||
status: `Downloading ${data.fileName}(${formatBytes(data.loaded)}/${formatBytes(data.total)
|
||||
})...`,
|
||||
status: `Downloading ${data.fileName}(${formatBytes(data.loaded)}/${
|
||||
formatBytes(data.total)
|
||||
})...`,
|
||||
});
|
||||
});
|
||||
await updateDownloader.startDownload();
|
||||
|
@ -557,12 +583,15 @@ function registerIPCPipes() {
|
|||
status: "Looking for patcher updates...",
|
||||
});
|
||||
await new Promise((res) => setTimeout(res, 1000));
|
||||
const patchFiles = await getEZPPLauncherUpdateFiles(osuPath);
|
||||
const [patchFiles, allUpdateFiles] = await getEZPPLauncherUpdateFiles(
|
||||
osuPath,
|
||||
);
|
||||
if (patchFiles.length > 0) {
|
||||
logger.log("EZPPLauncher updates found.");
|
||||
const patcherDownloader = await downloadEZPPLauncherUpdateFiles(
|
||||
osuPath,
|
||||
patchFiles,
|
||||
allUpdateFiles,
|
||||
);
|
||||
let errored = false;
|
||||
patcherDownloader.eventEmitter.on("error", (data) => {
|
||||
|
@ -583,8 +612,18 @@ function registerIPCPipes() {
|
|||
progress: Math.ceil(data.progress),
|
||||
});
|
||||
mainWindow.webContents.send("ezpplauncher:launchstatus", {
|
||||
status: `Downloading ${data.fileName}(${formatBytes(data.loaded)
|
||||
}/${formatBytes(data.total)})...`,
|
||||
status: `Downloading ${data.fileName}(${
|
||||
formatBytes(data.loaded)
|
||||
}/${formatBytes(data.total)})...`,
|
||||
});
|
||||
});
|
||||
patcherDownloader.eventEmitter.on("delete", (data) => {
|
||||
logger.log(`Deleting ${data.fileName}!`);
|
||||
mainWindow.webContents.send("ezpplauncher:launchprogress", {
|
||||
progress: -1,
|
||||
});
|
||||
mainWindow.webContents.send("ezpplauncher:launchstatus", {
|
||||
status: `Deleting ${data.fileName}...`,
|
||||
});
|
||||
});
|
||||
await patcherDownloader.startDownload();
|
||||
|
@ -664,7 +703,7 @@ function registerIPCPipes() {
|
|||
if (fs.existsSync(updateFile)) {
|
||||
await fs.promises.rm(updateFile, {
|
||||
force: true,
|
||||
recursive: (await fs.promises.lstat(updateFile)).isDirectory,
|
||||
recursive: (await fs.promises.lstat(updateFile)).isDirectory(),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -718,7 +757,8 @@ function registerIPCPipes() {
|
|||
const osuGameplayFile = path.join(osuPath, "osu!gameplay.dll");
|
||||
if (isWritable(osuUIFile) && isWritable(osuGameplayFile)) {
|
||||
logger.log(
|
||||
`Cleanup complete, took ${((performance.now() - timeStart) / 1000).toFixed(3)
|
||||
`Cleanup complete, took ${
|
||||
((performance.now() - timeStart) / 1000).toFixed(3)
|
||||
} seconds.`,
|
||||
);
|
||||
clearInterval(cleanup);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "ezpplauncher-next",
|
||||
"version": "2.1.6",
|
||||
"version": "2.1.7",
|
||||
"description": "EZPPLauncher rewritten with Svelte.",
|
||||
"private": false,
|
||||
"license": "MIT",
|
||||
|
|
|
@ -69,6 +69,7 @@ export default {
|
|||
resolve({
|
||||
browser: true,
|
||||
dedupe: ["svelte"],
|
||||
exportConditions: ["svelte"],
|
||||
}),
|
||||
typescript({
|
||||
sourceMap: !production,
|
||||
|
|
|
@ -1,20 +1,16 @@
|
|||
<script lang="ts">
|
||||
import {
|
||||
Avatar,
|
||||
Dropdown,
|
||||
DropdownItem,
|
||||
DropdownHeader,
|
||||
DropdownDivider,
|
||||
Button,
|
||||
Indicator,
|
||||
} from "flowbite-svelte";
|
||||
import {
|
||||
ArrowLeftSolid,
|
||||
ArrowRightFromBracketSolid,
|
||||
ArrowRightToBracketSolid,
|
||||
HeartSolid,
|
||||
UserSettingsSolid,
|
||||
} from "flowbite-svelte-icons";
|
||||
import Avatar from "flowbite-svelte/Avatar.svelte";
|
||||
import Dropdown from "flowbite-svelte/Dropdown.svelte";
|
||||
import DropdownItem from "flowbite-svelte/DropdownItem.svelte";
|
||||
import DropdownHeader from "flowbite-svelte/DropdownHeader.svelte";
|
||||
import DropdownDivider from "flowbite-svelte/DropdownDivider.svelte";
|
||||
import Button from "flowbite-svelte/Button.svelte";
|
||||
import Indicator from "flowbite-svelte/Indicator.svelte";
|
||||
import ArrowLeftSolid from "flowbite-svelte-icons/ArrowLeftSolid.svelte";
|
||||
import ArrowRightFromBracketSolid from "flowbite-svelte-icons/ArrowRightFromBracketSolid.svelte";
|
||||
import ArrowRightToBracketSolid from "flowbite-svelte-icons/ArrowRightToBracketSolid.svelte";
|
||||
import HeartSolid from "flowbite-svelte-icons/HeartSolid.svelte";
|
||||
import UserSettingsSolid from "flowbite-svelte-icons/UserSettingsSolid.svelte";
|
||||
import ezppLogo from "../public/favicon.png";
|
||||
import {
|
||||
currentPage,
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
<script lang="ts">
|
||||
import { Button } from "flowbite-svelte";
|
||||
import Button from "flowbite-svelte/Button.svelte";
|
||||
import Progressbar from "../lib/Progressbar.svelte";
|
||||
import {
|
||||
launching,
|
||||
patch,
|
||||
launchStatus,
|
||||
launchPercentage
|
||||
launchPercentage,
|
||||
} from "./../storage/localStore";
|
||||
let progressbarFix = true;
|
||||
|
||||
|
|
|
@ -1,10 +1,14 @@
|
|||
<script lang="ts">
|
||||
import { Input, Button, Spinner, Checkbox } from "flowbite-svelte";
|
||||
import Input from "flowbite-svelte/Input.svelte";
|
||||
import Button from "flowbite-svelte/Button.svelte";
|
||||
import Spinner from "flowbite-svelte/Spinner.svelte";
|
||||
import Checkbox from "flowbite-svelte/Checkbox.svelte";
|
||||
import { type User } from "../types/user";
|
||||
import { currentPage, currentUser, startup } from "../storage/localStore";
|
||||
import toast from "svelte-french-toast";
|
||||
import { Page } from "../consts/pages";
|
||||
import { EyeSlashSolid, EyeSolid } from "flowbite-svelte-icons";
|
||||
import EyeSolid from "flowbite-svelte-icons/EyeSolid.svelte";
|
||||
import EyeSlashSolid from "flowbite-svelte-icons/EyeSlashSolid.svelte";
|
||||
|
||||
let loading = false;
|
||||
let username = "";
|
||||
|
@ -13,11 +17,20 @@
|
|||
let showPassword = false;
|
||||
|
||||
const processLogin = async () => {
|
||||
if (username.length <= 0 || password.length <= 0) {
|
||||
toast.error(`Please provice a valid Username and Password!`, {
|
||||
position: "bottom-center",
|
||||
className:
|
||||
"dark:!bg-gray-800 border-1 dark:!border-gray-700 dark:!text-gray-100",
|
||||
duration: 3000,
|
||||
});
|
||||
return;
|
||||
}
|
||||
loading = true;
|
||||
const loginPromise = new Promise<void>((res, rej) => {
|
||||
const loginPromise = new Promise<string>((res, rej) => {
|
||||
window.addEventListener(
|
||||
"login-result",
|
||||
(e) => {
|
||||
async (e) => {
|
||||
const customEvent = e as CustomEvent;
|
||||
const resultData = customEvent.detail;
|
||||
const wasSuccessful = "user" in resultData;
|
||||
|
@ -30,26 +43,26 @@
|
|||
"dark:!bg-gray-800 border-1 dark:!border-gray-700 dark:!text-gray-100",
|
||||
duration: 1500,
|
||||
}); */
|
||||
rej();
|
||||
rej(resultData.message);
|
||||
loading = false;
|
||||
return;
|
||||
}
|
||||
const userResult = resultData.user as User;
|
||||
currentUser.set(userResult);
|
||||
currentPage.set(Page.Launch);
|
||||
res();
|
||||
res("");
|
||||
toast.success(`Welcome back, ${userResult.name}!`, {
|
||||
position: "bottom-center",
|
||||
className:
|
||||
"dark:!bg-gray-800 border-1 dark:!border-gray-700 dark:!text-gray-100",
|
||||
duration: 3000
|
||||
duration: 3000,
|
||||
});
|
||||
},
|
||||
{ once: true }
|
||||
);
|
||||
window.dispatchEvent(
|
||||
new CustomEvent("login-attempt", {
|
||||
detail: { username, password, saveCredentials }
|
||||
detail: { username, password, saveCredentials },
|
||||
})
|
||||
);
|
||||
});
|
||||
|
@ -58,20 +71,20 @@
|
|||
{
|
||||
loading: "Logging in...",
|
||||
success: "Successfully logged in!",
|
||||
error: "Invalid Username or Password!"
|
||||
error: (e) => e,
|
||||
},
|
||||
{
|
||||
position: "bottom-center",
|
||||
className:
|
||||
"dark:!bg-gray-800 border-1 dark:!border-gray-700 dark:!text-gray-100",
|
||||
duration: 3000
|
||||
duration: 0,
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
const tryAutoLogin = async () => {
|
||||
loading = true;
|
||||
const loginPromise = new Promise<void>((res, rej) => {
|
||||
const loginPromise = new Promise<string>((res, rej) => {
|
||||
window.addEventListener(
|
||||
"login-result",
|
||||
(e) => {
|
||||
|
@ -81,29 +94,29 @@
|
|||
const wasSuccessful = "user" in resultData;
|
||||
if (isGuest) {
|
||||
currentPage.set(Page.Launch);
|
||||
res();
|
||||
res("");
|
||||
toast.success(`Logged in as Guest`, {
|
||||
position: "bottom-center",
|
||||
className:
|
||||
"dark:!bg-gray-800 border-1 dark:!border-gray-700 dark:!text-gray-100",
|
||||
duration: 3000
|
||||
duration: 3000,
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (!wasSuccessful) {
|
||||
loading = false;
|
||||
rej();
|
||||
rej(resultData.message);
|
||||
return;
|
||||
}
|
||||
const userResult = resultData.user as User;
|
||||
currentUser.set(userResult);
|
||||
currentPage.set(Page.Launch);
|
||||
res();
|
||||
res("");
|
||||
toast.success(`Welcome back, ${userResult.name}!`, {
|
||||
position: "bottom-center",
|
||||
className:
|
||||
"dark:!bg-gray-800 border-1 dark:!border-gray-700 dark:!text-gray-100",
|
||||
duration: 3000
|
||||
duration: 3000,
|
||||
});
|
||||
loading = false;
|
||||
},
|
||||
|
@ -116,13 +129,13 @@
|
|||
{
|
||||
loading: "Logging in...",
|
||||
success: "Successfully logged in!",
|
||||
error: "Failed to login."
|
||||
error: (e) => e,
|
||||
},
|
||||
{
|
||||
position: "bottom-center",
|
||||
className:
|
||||
"dark:!bg-gray-800 border-1 dark:!border-gray-700 dark:!text-gray-100",
|
||||
duration: 3000
|
||||
duration: 0,
|
||||
}
|
||||
);
|
||||
};
|
||||
|
@ -134,7 +147,7 @@
|
|||
position: "bottom-center",
|
||||
className:
|
||||
"dark:!bg-gray-800 border-1 dark:!border-gray-700 dark:!text-gray-100",
|
||||
duration: 3000
|
||||
duration: 3000,
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
<script lang="ts">
|
||||
import { Button, ButtonGroup, Input, Toggle } from "flowbite-svelte";
|
||||
import { FileSearchSolid, FolderSolid } from "flowbite-svelte-icons";
|
||||
import Button from "flowbite-svelte/Button.svelte";
|
||||
import ButtonGroup from "flowbite-svelte/ButtonGroup.svelte";
|
||||
import Input from "flowbite-svelte/Input.svelte";
|
||||
import Toggle from "flowbite-svelte/Toggle.svelte";
|
||||
import FileSearchSolid from "flowbite-svelte-icons/FileSearchSolid.svelte";
|
||||
import FolderSolid from "flowbite-svelte-icons/FolderSolid.svelte";
|
||||
import { patch, presence, logging } from "./../storage/localStore";
|
||||
|
||||
let folderPath: string = "";
|
||||
|
|
Loading…
Reference in New Issue
Block a user