Skip to content

Commit

Permalink
more code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Percslol committed Sep 16, 2024
1 parent 03e02cb commit ae396e9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
11 changes: 5 additions & 6 deletions src/Anura.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ class Anura {
dialog: Dialog;
sw: SWProcess;
anurad: Anurad;
systray: Systray;
uri = new URIHandlerAPI();
files = new FilesAPI();
wm = new WMAPI();
ContextMenu = ContextMenuAPI;

private constructor(
fs: AnuraFilesystem,
Expand Down Expand Up @@ -76,8 +81,6 @@ class Anura {
return anuraPartial;
}

wm = new WMAPI();

apps: any = {};
libs: any = {};
logger = {
Expand Down Expand Up @@ -163,7 +166,6 @@ class Anura {
await anura.registerLib(lib); // This will let us capture error messages
return lib;
}
ContextMenu = ContextMenuAPI;
removeStaleApps() {
for (const appName in anura.apps) {
const app = anura.apps[appName];
Expand All @@ -176,7 +178,6 @@ class Anura {
taskbar.updateTaskbar();
alttab.update();
}
systray: Systray;
async import(packageName: string, searchPath?: string) {
if (searchPath) {
// Using node-style module resolution
Expand Down Expand Up @@ -219,8 +220,6 @@ class Anura {
const version = splitName[1] || null;
return await this.libs[pkg].getImport(version);
}
uri = new URIHandlerAPI();
files = new FilesAPI();
get wsproxyURL() {
return this.settings.get("wisp-url");
}
Expand Down
4 changes: 2 additions & 2 deletions src/oobe/OobeView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,7 @@ class OobeView {
}
}

async function installx86() {
const tracker = document.getElementById("tracker");
async function installx86(tracker = document.getElementById("tracker")) {
console.debug("installing x86");
const x86image = anura.settings.get("x86-image");
tracker!.innerText = "Downloading x86 kernel";
Expand Down Expand Up @@ -422,6 +421,7 @@ async function installx86() {

console.debug("done");
}

async function preloadFiles(tracker = document.getElementById("tracker")) {
try {
const list = await (await fetch("cache-load.json")).json();
Expand Down

0 comments on commit ae396e9

Please sign in to comment.