fix: Fixed romm login, now uses token
feat: Moved romm to internal plugin fix: Made focusing and navigation more reliable fix: Loading errors on first time launch
This commit is contained in:
parent
7c10f4e4c2
commit
816d50ae4d
81 changed files with 1659 additions and 1097 deletions
|
|
@ -74,17 +74,20 @@ export async function openExternal (target: string)
|
|||
}
|
||||
}
|
||||
|
||||
export function hashFile (path: string, algorithm: "sha1" | "md5"): Promise<string>
|
||||
export async function hashFile (path: string, algorithm: Bun.SupportedCryptoAlgorithms)
|
||||
{
|
||||
return new Promise((resolve, reject) =>
|
||||
{
|
||||
const hash = createHash(algorithm);
|
||||
const stream = createReadStream(path);
|
||||
const hasher = new Bun.CryptoHasher(algorithm);
|
||||
const stream = Bun.file(path).stream();
|
||||
const reader = stream.getReader();
|
||||
|
||||
stream.on("data", (data) => hash.update(data));
|
||||
stream.on("end", () => resolve(hash.digest("hex")));
|
||||
stream.on("error", reject);
|
||||
});
|
||||
while (true)
|
||||
{
|
||||
const { done, value } = await reader.read();
|
||||
if (done) break;
|
||||
hasher.update(value);
|
||||
}
|
||||
|
||||
return hasher.digest('hex');
|
||||
}
|
||||
|
||||
export class SeededRandom
|
||||
|
|
@ -118,19 +121,20 @@ export function toggleElementInConfig<T> (id: KeysWithValueAssignableTo<Settings
|
|||
{
|
||||
const disabled = config.get(id as any) as T[];
|
||||
if (enabled)
|
||||
{
|
||||
const index = disabled.indexOf(element);
|
||||
if (index < 0)
|
||||
{
|
||||
config.set('disabledPlugins', disabled.concat(element));
|
||||
}
|
||||
} else
|
||||
{
|
||||
const index = disabled.indexOf(element);
|
||||
if (index >= 0)
|
||||
{
|
||||
config.set('disabledPlugins', disabled.toSpliced(index, 1));
|
||||
}
|
||||
} else
|
||||
{
|
||||
const index = disabled.indexOf(element);
|
||||
if (index < 0)
|
||||
{
|
||||
config.set('disabledPlugins', disabled.concat(element));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue