mirror of
https://github.com/zumbiepig/MineXLauncher.git
synced 2025-06-08 07:54:49 +00:00
add toggle function
This commit is contained in:
parent
87379f5a93
commit
e1c382be28
@ -287,6 +287,18 @@ const mods = {
|
|||||||
storage.local.set('mods', mods);
|
storage.local.set('mods', mods);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
toggle: function (mod: string): void {
|
||||||
|
const mods: string[] = storage.local.get('mods') ?? [];
|
||||||
|
const modIndex = mods.indexOf(mod);
|
||||||
|
if (modIndex === -1) {
|
||||||
|
mods.push(mod);
|
||||||
|
mods.sort();
|
||||||
|
storage.local.set('mods', mods);
|
||||||
|
} else {
|
||||||
|
mods.splice(modIndex, 1);
|
||||||
|
storage.local.set('mods', mods);
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const serviceworker = {
|
const serviceworker = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user